linux view operating system command

一、linux CPU大小 cat /proc/cpuinfo |grep "model name" && cat /proc/cpuinfo |grep "physical id"

img

Note: Under Linux, you can see the detailed information of each cpu in /proc/cpuinfo. But for dual-core cpu, you will see two cpu in cpuinfo. It is often mistaken for two single-core CPUs. In fact, the physical processor ID should be used to distinguish single-core and dual-core. Physical Processor ID and can be found in cpuinfo or dmesg. Flags if the number of support Hyper-Threading Technology Description ht determined physical CPU can see the physical id value, compared with the same two, memory size

cat /proc/meminfo |grep MemTotal

img

*3. Hard disk size*** fdisk -l |grep Disk **img

Four, uname -a # Linux system information command to view kernel/operating system/CPU information

img

Five, head -n 1 /etc/issue # View the operating system version, it is the number 1 not the letter L

img

Six, cat /proc/cpuinfo # Linux system information command to view CPU information

img

img

Seven, hostname # View the Linux system information command of the computer name

img

Eight, lspci -tv # List all PCI devices

img

Nine, lsusb -tv # List all the linux system information commands of USB devices

img

Ten, lsmod # List loaded kernel modules

Copy code

Module                  Size  Used by
autofs4                26513  3 
sunrpc                260521  1 
8021q                  25317  0 
garp                    7152  1 8021q
stp                     2218  1 garp
llc                     5546  2 garp,stp
cpufreq_ondemand       10544  2 
powernow_k8            18171  1 
freq_table              4936  2 cpufreq_ondemand,powernow_k8
mperf                   1557  1 powernow_k8
ip6t_REJECT             4628  2 
nf_conntrack_ipv6       8748  2 
nf_defrag_ipv6         11182  1 nf_conntrack_ipv6
xt_state                1492  2 
nf_conntrack           79357  2 nf_conntrack_ipv6,xt_state
ip6table_filter         2889  1 
ip6_tables             19458  1 ip6table_filter
ipv6                  321422  47 ip6t_REJECT,nf_conntrack_ipv6,nf_defrag_ipv6
ppdev                   8537  0 
parport_pc             22690  0 
parport                36209  2 ppdev,parport_pc
asus_atk0110           14216  0 
sg                     29350  0 
microcode             112653  0 
serio_raw               4594  0 
k10temp                 3609  0 
edac_core              46581  0 
edac_mce_amd           14705  0 
snd_hda_codec_realtek    68136  1 
snd_hda_intel          27823  2 
snd_hda_codec         121518  2 snd_hda_codec_realtek,snd_hda_intel
snd_hwdep               6652  1 snd_hda_codec
snd_seq                55759  1 
snd_seq_device          6500  1 snd_seq
snd_pcm                86635  2 snd_hda_intel,snd_hda_codec
snd_timer              22411  3 snd_seq,snd_pcm
snd                    69907  14 snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_seq,snd_seq_device,snd_pcm,snd_timer
soundcore               7958  1 snd
snd_page_alloc          8470  2 snd_hda_intel,snd_pcm
i2c_piix4              12608  0 
r8169                  60023  0 
mii                     5376  1 r8169
shpchp                 32778  0 
ext4                  363408  3 
mbcache                 8193  1 ext4
jbd2                   90230  1 ext4
sr_mod                 15177  0 
cdrom                  39085  1 sr_mod
sd_mod                 38976  3 
crc_t10dif              1541  1 sd_mod
ahci                   41127  2 
pata_acpi               3701  0 
ata_generic             3837  0 
pata_atiixp             4211  0 
radeon                917108  0 
ttm                    80957  1 radeon
drm_kms_helper         40087  1 radeon
drm                   265638  3 radeon,ttm,drm_kms_helper
i2c_algo_bit            5935  1 radeon
i2c_core               31084  5 i2c_piix4,radeon,drm_kms_helper,drm,i2c_algo_bit
dm_mirror              14133  0 
dm_region_hash         12085  1 dm_mirror
dm_log                  9930  2 dm_mirror,dm_region_hash
dm_mod                 82839  11 dm_mirror,dm_log

Copy code

Eleven, env # View environment variable resources

Copy code

LESS_TERMCAP_mb=
HOSTNAME=localhost.localdomain
LESS_TERMCAP_md=
LESS_TERMCAP_me=
TERM=xterm
SHELL=/bin/bash
HISTSIZE=1000
NLS_LANG=AMERICAN_AMERICA.AL32UTF8
SSH_CLIENT=192.168.1.104 2465 22
QTDIR=/usr/lib64/qt-3.3
OLDPWD=/home
LESS_TERMCAP_ue=
QTINC=/usr/lib64/qt-3.3/include
SSH_TTY=/dev/pts/1
USER=root
LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib:
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:
ORACLE_BASE=/usr/lib/oracle/11.2
LESS_TERMCAP_us=
MAIL=/var/spool/mail/root
PATH=/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/erlang/bin:/home/rabbitmq_server-3.3.1/sbin/:/usr/lib/oracle/11.2/client64/bin:/root/bin
PWD=/
LANG=zh_CN.UTF-8
KDE_IS_PRELINKED=1
MODULEPATH=/usr/share/Modules/modulefiles:/etc/modulefiles
LOADEDMODULES=
KDEDIRS=/usr
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
HISTCONTROL=ignoredups
SHLVL=1

Copy code

12. free -m # View memory usage and swap area usage

             total       used       free     shared    buffers     cached
Mem:          3706       3534        171          0         31       3258
-/+ buffers/cache:        244       3461
Swap:         3711          0       3711
[root@localhost /]# 

13. df -h # View the usage of each partition

Copy code

[root@localhost /]# df -h
文件系统          容量  已用  可用 已用%% 挂载点
/dev/mapper/VolGroup-lv_root
                       50G  6.4G   41G  14% /
tmpfs                 1.9G   72K  1.9G   1% /dev/shm
/dev/sda1             485M   38M  422M   9% /boot
/dev/mapper/VolGroup-lv_home
                      406G  2.8G  382G   1% /home

Copy code

The following demonstrates not one by one

Fourteen, du -sh # View the size of the specified directory 15, grep MemTotal /proc/meminfo # View the total amount of memory 16, grep MemFree /proc/meminfo # View the amount of free memory 17, uptime # View the system running time, Number of users, load 18, cat /proc/loadavg # View system load disks and partitions 19, mount | column -t # View the status of mounted partitions 20, fdisk -l # View all partitions 21, swapon- s # View all swap partitions 22, hdparm -i /dev/hda # View disk parameters (only for IDE devices) 23, dmesg | grep IDE # View IDE device detection status at startup Network 24, ifconfig # View the attributes of all network interfaces 25, iptables -L # View firewall settings 26, route -n # View routing table 27, netstat -lntp # View all listening ports 28, netstat -antp # View All established connections 29, netstat -s # View network statistics Process 30, ps -ef # View all processes 31, top # Real-time display of process status User 32, w # View active user 30 Three, id # View specified user information 34, last # View user login log Thirty-five, cut -d: -f1 /etc/passwd # view all users of the system thirty-six, cut -d: -f1 /etc/group # view all groups thirty-seven of the system , crontab -l # view the current user's Scheduled task service 37, chkconfig --list # List all system services 38, chkconfig –list | grep on # List all started system service programs 39, rpm -qa # View all installed packages 4 10. cat /proc/cpuinfo: Linux system commands for viewing CPU related parameters 41. cat /proc/partitions: System information commands for viewing Linux hard disk and partition information 42. cat /proc/meminfo: Viewing Linux system memory Forty-three linux system commands for information , cat /proc/version: view version, similar to uname -r forty-four, cat /proc/ioports: view device io port forty-five, cat /proc/interrupts: view interrupt forty-four 6. cat /proc/pci: view the information of pci equipment 47. cat /proc/swaps: view the information of all swap partitions

If you think it is helpful to you, please click on the recommendation and send me to the hot search, thank you!

The above is the Linux-related knowledge shared by Liangxu Tutorial Network for all friends.

Guess you like

Origin blog.csdn.net/manongxianfeng/article/details/112990821