View basic information about Linux system, version information command Daquan

  1. uname -a (Linux operating system kernel to see the current version information)
  2. cat / proc / version (Linux operating system to view the current version information)
  3. cat / etc / issue or cat / etc / redhat-release (Linux version of the current operating system to view release information)
  4. CAT / proc / cpuinfo
    lscpu (see cpu Linux-related information, including the type, frequency, core information, etc.)
  5. getconf LONG_BIT (Linux view the release notes for the current CPU running in 32bit mode, but it does not mean that the CPU does not support 64bit)
  6. hostname (see the server name)
  7. ifconfig (view network information)

  8. lsblk (See Disk - lists all available information block device, but also show the dependency between them, but it does not list the information of the RAM disk)
    the fdisk -l (observe the physical disk usage, but also on hard disk partition)
    DF -k (disk space available on the disk partition for display)

[Attached] System Information Daquan
# uname -a # View kernel / operating system / CPU Information 
# head -n 1 / etc / issue # check the OS version 
# cat / proc / cpuinfo # View CPU Information 
# hostname # View the computer name 
# lspci -tv # list all PCI devices 
# lsusb -tv # lists all USB devices 
# lsmod # listed loaded kernel modules 
# env # viewing environment variable resource 
# free -m # View the amount of memory usage and swap 
# df -h # see how each partition usage 
# du -sh <directory name> # see the size of the specified directory 
# grep MemTotal / proc / meminfo # view the amount of memory 
# grep MemFree / proc / meminfo # view the amount of free memory 
# uptime # View system uptime, number of users, load 
# cat / proc / loadavg # View system load disk and partition 
# mount | # View articulated column -t partition status 
# fdisk -l # View all partition 
# swapon -s # View All swap partition 
# hdparm -i / dev / hda # View disk parameters (only for IDE devices) 
# Dmesg | grep IDE # view when you start the IDE device detection status of the network 
# ifconfig # View all the properties of the network interface 
# iptables -L # View firewall settings 
# route -n # View the routing table 
# netstat -lntp # View all listening ports 
# netstat -antp # view all established connections 
# netstat -s # View network statistics process 
# ps -ef # view all processes 
# top # display real-time status of the user process 
# w # view active user 
# id <user name> # View user information 
# last # view the user login log 
# cut -d: All users -f1 / etc / passwd # View system 
# cut -d: -f1 / etc / group # group to see all system 
# crontab -l # View the current user Scheduled tasks service 
# chkconfig -list # lists all system services 
# chkconfig -list | grep on # lists all system services program starts 

# Rpm -qa # View all the packages installed

View / proc / uptime file computing system startup time:
CAT / proc / uptime
output: 5,113,396.94 575,949.85

The first digital system that is already running time 5,113,396.94 seconds, the system start-up time can be calculated using the system tools date

date -d "$(awk -F. '{print $1}' /proc/uptime) second ago" +"%Y-%m-%d %H:%M:%S"

Output: 2018-01-02 06:50:52

View / proc / uptime file computing system uptime

. Cat / proc / uptime | awk -F '{run_days = $ 1/86400; run_hour = ($ 1% 86400) / 3600; run_minute = ($ 1% 3600) / 60; run_second = $ 1% 60; printf ( "system has been :% d% at day D% d% d minutes seconds ", run_days, run_hour, run_minute, run_second)} '

Output: The system has been running: one day 1:36:13

See Linux number of physical CPU, core number, the number of logical CPU
# = the total number of nuclei per physical CPU number X number of pieces of the physical CPU core 
# Total number of logical CPU number X = physical CPU core pieces per physical CPU X hyperthreads

# View the number of physical CPU
CAT / proc / cpuinfo | grep "PHYSICAL the above mentioned id" | the Sort | uniq | WC the -l
2

# Check each physical CPU core in the number (ie audit)
CAT / proc / cpuinfo | grep "the CPU Cores" | uniq
the CPU Cores: 2

View the number of logical CPU #
cat / proc / cpuinfo | grep " processor" | wc -l


# View CPU information (model)
CAT / proc / cpuinfo | grep name | Cut -f2 -d: | uniq -c
      4 Intel (R) Core (TM) i5-6500 CPU @ 3.20GHz

Input command cat / proc / cpuinfo view, there are several physical id several physical CPU; There are several view, there are several logical processor cpu.
(A) concept
① physical CPU
number in the Server CPU actual slot
number of physical cpu, can not be repeated a number of physical id Several
② logical CPU 
/ proc / cpuinfo cpu hardware used to store information
content listed separately the processor 0 -processor n specifications. It should be noted, n + 1 is the number of logical cpu
normal circumstances, how can we believe a cpu core intel coupled with Hyper-Threading technology (HT), could be split to double the number of cpu core logic out on the
number of logical CPU = physical quantity x cpu cores cpu this specification value x 2 (if supported and open HT)    
Remarks about: Linux top view of the CPU is a logical CPU number
 ③ CPU core number
one above CPU chipset can handle the number of data, such as current i5 760, is a dual-core CPU four threads, four and i5 2250 CPU core four threads
in general, the physical CPU number × number of cores equal to the number every single logical CPU would be, if not equal, it indicates that the server's CPU supports Hyper-Threading technology

lscpu command to check the statistics cpu information


RAM

Summary view memory case free -m details: cat / proc / meminfo

Check the hard disk and partition distribution: lsblk

For more information and to see if the hard disk partition: fdisk -l

Use "df -k" command, in KB Displays disk usage and occupancy, -m is based M displays disk usage and occupancy

NIC

View Card hardware information
# lspci | grep -i 'eth'
02: 00.0 Ethernet the Controller: Realtek Semiconductor Co., Ltd. RTL8111 / 8168B PCI Express Gigabit Ethernet the Controller (Rev 06)

View any network interface: ifconfig -a

If you want to view details of a network interface, for example, detailed parameters and indicators for eth0: ethtool eth0

View pci information, that all of the hardware motherboard slot Information: lspci

If you want more detailed information: lspci -v or lspci -vv

To see the device tree: lspci -t


 Linux / proc directory Comments

1. / proc directory
Linux kernel provides a through / proc filesystem, the kernel access to internal data structures at runtime, change the mechanism of the kernel settings. proc file system is a pseudo file system exists only among the memory, external memory without taking up space. It is the operating system kernel to access the data in a manner that provides an interface to the file system.
Users and applications can be obtained by the information system proc, certain parameters may be changed and the kernel. Due to information systems, such as the process is dynamically changing, so the user or application reads the proc file, proc file system is a dynamic system kernel is read out from the required information and submit. These files or sub folders listed below, are not present in your system, depending on your kernel configuration and module loading. In addition, under / proc there are three very important directories: net, scsi, and sys. Sys directory is writable, parameters or modify the kernel can be accessed through it, and is dependent on the net and scsi kernel configuration. For example, if the system does not support scsi, the scsi directory does not exist.
In addition to those described above, there are a number of directories named with numbers, which is the process directory. The system is currently running in each process has a corresponding directory under / proc, PID number of the process to the directory name, they process information is read interface. The self is the reading process itself directory information interface is a link.

2. sub-files or sub-folders
/ proc / buddyinfo each memory area of each order how many blocks are available, and memory fragmentation issues
passed to / cmdline start / proc parameter information kernel of
information / proc / cpuinfo cpu's
all encrypted passwords and details of the / proc / crypto used by the kernel installed
/ proc / devices already loaded equipment and classification
/ proc / dma registered to use the DMA channel list the ISA
/ proc / execdomains Linux kernel currently supported Execution Domains
/ proc / fb frame buffer device list, including the number and controlling its driving
/ proc / filesystems currently supported kernel file system type
/ proc / interrupts x86 architecture each of the interrupts IRQ
/ proc / iomem each physical device is currently in system memory mapping
/ proc / ioports registered port range input-output device used by a
physical memory / proc / kcore the representative system, the file format is stored as the core, the number of bytes inside the display, plus the size of the RAM is equal to 4KB
/ proc / kmsg record information generated by the kernel, may be processed by / sbin / klogd or / bin / the dmesg
/ proc / loadavg state and over a period of time of the CPU according to IO Resulting load status, and related uptime command
/ proc / locks to lock the core list of files
/ proc / mdstat multi-drive, RAID configuration information (MD = Multiple Disks)
/ proc / information meminfo RAM using
/ proc / misc other major equipment (device number 10) registered on the drive
/ proc / modules all add to kernel module list
all mounted / proc / mounts used in the system
Memory / proc / mtrr system using Type Range Registers (MTRRs)
blocks allocated / proc / partitions partition information
PCI device list / proc / pci system
/ proc / slabinfo system slab caches all activity information
/ proc / stat of all CPU activity information
/ proc / sysrq-trigger use the echo command to write the file, a remote root user can execute most system request key command, it seems to perform the same as in the local terminal. To write to this file, you need to / proc / sys / kernel / sysrq not be set to 0. The root of the file is unreadable
/ proc / uptime how long the system has been running for
the use of / proc / swaps swap space
/ proc / version Linux kernel version and gcc version
/ proc / bus system bus (Bus) information, such as pci / usb like
/ proc / driver driving information
/ proc / fs file system information
/ proc / ide ide device information
/ proc / irq interrupt requesting device information
/ proc / net card device information
/ proc / scsi scsi devices information
/ proc / tty tty devices information
/ proc / net / dev show network adapter and statistical information
/ proc / vmstat virtual memory statistics
/ memory image of your proc / vmcore kernel panic
/ proc / diskstats obtain disk information
/ proc / schedstat kernel scheduler statistics
/ proc / zoneinfo displays statistics of the memory space, virtual memory behavior analysis is useful

The following is / proc directory process N information
/ proc / N pid is N process information
/ proc / N / cmdline process startup command
/ proc / N / cwd linked to the process of the current working directory
/ proc / N / environ process environment variables list
/ proc / N / exe linked to the process of implementation of the command file
for all file descriptors / proc / N / fd contains process-related
/ proc / N / maps memory map information associated with the process
/ proc / N / mem refer to the process of holding memory, unreadable
root directory / proc / N / root linked to the process of
state / proc / N / stat process of
memory state / proc / N / statm process uses
/ proc / N / status process status information than stat / statm more readable
/ proc / self link to the currently running process

 

Published 80 original articles · won praise 96 · views 360 000 +

Guess you like

Origin blog.csdn.net/Alen_xiaoxin/article/details/104842874