Common commands for viewing system configurations in Linux

Source: Internet
Author: User
Tags dmesg

Common commands for viewing system configurations in Linux

I. linux CPU size
Cat/proc/cpuinfo | grep "model name" & cat/proc/cpuinfo | grep "physical id"


Note: in Linux, you can view detailed information about each cpu in/proc/cpuinfo. However, for dual-core CPUs, two CPUs are displayed in cpuinfo. It is often mistaken for two single-core CPUs.
In fact, Physical Processor ID should be used to distinguish between single-core and dual-core. Physical Processor ID can be found from cpuinfo or dmesg. flags if there is ht, the value of physical id can be viewed if it supports hyper-Threading Technology to determine the number of Physical CPUs.
Ii. Memory size

Cat/proc/meminfo | grep MemTotal

Iii. Hard Disk size
Fdisk-l | grep Disk

IV,
Uname-a # linux system information command for viewing kernel/operating system/CPU Information


V. head-n 1/etc/issue # Check the operating system version. The number is 1, not the letter L.

Vi. cat/proc/cpuinfo # linux system information command for viewing CPU Information

VII. hostname # linux system information command for viewing computer names

8. lspci-TV # list all PCI devices

IX. lsusb-TV # linux system information commands for listing all USB devices

10. lsmod # list the loaded Kernel Modules

Module Size Used byautofs4 26513 3 sunrpc 260521 1 8021q 25317 0 garp 7152 1 8021qstp 2218 1 garpllc 5546 2 garp,stpcpufreq_ondemand 10544 2 powernow_k8 18171 1 freq_table 4936 2 cpufreq_ondemand,powernow_k8mperf 1557 1 powernow_k8ip6t_REJECT 4628 2 nf_conntrack_ipv6 8748 2 nf_defrag_ipv6 11182 1 nf_conntrack_ipv6xt_state 1492 2 nf_conntrack 79357 2 nf_conntrack_ipv6,xt_stateip6table_filter 2889 1 ip6_tables 19458 1 ip6table_filteripv6 321422 47 ip6t_REJECT,nf_conntrack_ipv6,nf_defrag_ipv6ppdev 8537 0 parport_pc 22690 0 parport 36209 2 ppdev,parport_pcasus_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_intelsnd_hwdep 6652 1 snd_hda_codecsnd_seq 55759 1 snd_seq_device 6500 1 snd_seqsnd_pcm 86635 2 snd_hda_intel,snd_hda_codecsnd_timer 22411 3 snd_seq,snd_pcmsnd 69907 14 snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_seq,snd_seq_device,snd_pcm,snd_timersoundcore 7958 1 sndsnd_page_alloc 8470 2 snd_hda_intel,snd_pcmi2c_piix4 12608 0 r8169 60023 0 mii 5376 1 r8169shpchp 32778 0 ext4 363408 3 mbcache 8193 1 ext4jbd2 90230 1 ext4sr_mod 15177 0 cdrom 39085 1 sr_modsd_mod 38976 3 crc_t10dif 1541 1 sd_modahci 41127 2 pata_acpi 3701 0 ata_generic 3837 0 pata_atiixp 4211 0 radeon 917108 0 ttm 80957 1 radeondrm_kms_helper 40087 1 radeondrm 265638 3 radeon,ttm,drm_kms_helperi2c_algo_bit 5935 1 radeoni2c_core 31084 5 i2c_piix4,radeon,drm_kms_helper,drm,i2c_algo_bitdm_mirror 14133 0 dm_region_hash 12085 1 dm_mirrordm_log 9930 2 dm_mirror,dm_region_hashdm_mod 82839 11 dm_mirror,dm_log

11. env # view environment variable resources

LESS_TERMCAP_mb=HOSTNAME=localhost.localdomainLESS_TERMCAP_md=LESS_TERMCAP_me=TERM=xtermSHELL=/bin/bashHISTSIZE=1000NLS_LANG=AMERICAN_AMERICA.AL32UTF8SSH_CLIENT=192.168.1.104 2465 22QTDIR=/usr/lib64/qt-3.3OLDPWD=/homeLESS_TERMCAP_ue=QTINC=/usr/lib64/qt-3.3/includeSSH_TTY=/dev/pts/1USER=rootLD_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.2LESS_TERMCAP_us=MAIL=/var/spool/mail/rootPATH=/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/binPWD=/LANG=zh_CN.UTF-8KDE_IS_PRELINKED=1MODULEPATH=/usr/share/Modules/modulefiles:/etc/modulefilesLOADEDMODULES=KDEDIRS=/usrSSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpassHISTCONTROL=ignoredupsSHLVL=1

12. free-m # view memory usage and swap zone usage

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

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

[Root @ localhost/] # df-H file system capacity in use available % mount point/dev/mapper/VolGroup-lv_root 50G 6.4G 41G 14%/tmpfs 1.9G 72 K 1.9G 1%/dev/shm/dev/sda1 485 M 38 M 422 M 9%/boot/dev/mapper/VolGroup-lv_home 406G 2.8G 382G 1%/home

The following is not a one-to-one demonstration.


14. du-sh # view the size of the specified directory
15th, grep MemTotal/proc/meminfo # view total memory
Sixteen, grep MemFree/proc/meminfo # view the Amount of idle memory
17. uptime # view system running time, number of users, and load
18. cat/proc/loadavg # view system load disks and partitions
19. mount | column-t # view the status of the mounted Partition
20. fdisk-l # view all partitions
21. swapon-s # view all swap partitions
22. hdparm-I/dev/hda # view disk parameters (only applicable to IDE devices)
Twenty-three, dmesg | grep IDE # view the network of the IDE Device Detection Status at startup
24. ifconfig # view the attributes of all network interfaces
25. iptables-L # view firewall settings
26. route-n # view the route table
27. netstat-lntp # view all listening ports
28th, netstat-antp # view all established connections
19th, netstat-s # view network statistics process
Thirty, ps-ef # view all processes
, Top # real-time display of Process status users
And w # view active users
33. id # view specified user information
34. last # view User Logon logs
35. cut-d:-f1/etc/passwd # view all users in the system
36. cut-d:-f1/etc/group # view all groups in the system
37. crontab-l # view the scheduled Task Service of the current user
37. chkconfig-list # list all system services
38. chkconfig-list | grep on # list all started system service programs
Thirty-nine, rpm-qa # view all installed software packages
Forty, cat/proc/cpuinfo: linux system command for viewing CPU-related parameters
Forty-one, cat/proc/partitions: Command for viewing linux hard disk and partition information
Forty-two, cat/proc/meminfo: linux system command for viewing linux system memory information
Forty-three, cat/proc/version: view the version, similar to uname-r
Forty-four, cat/proc/ioports: view the device's io port
Forty-five, cat/proc/interrupts: view the interrupt
Forty-six, cat/proc/pci: View pci device information
Forty-seven, cat/proc/swaps: View information of all swap partitions

If you do not work hard today, tomorrow will lag behind

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.