Common commands for viewing Linux system information

Source: Internet
Author: User


Commonly used Linux system information command system # uname-a # view kernel/operating system/CPU information # head-n 1/etc/issue # view OS version # cat/proc/cpuinfo # view CPU information # hostname # View computer name # lspci-TV # list all PCI devices # lsusb-TV # list all USB devices # lsmod # list loaded kernel modules # env # View environment Variable
Resource # free-m # view memory usage and swap zone usage # df-h # view the usage of each partition # du-sh <Directory Name> # view the size of a specified directory # grep MemTotal/ proc/meminfo # view the total memory # grep MemFree/proc/meminfo # view the Amount of idle memory # uptime # view the system running time, number of users, and load # cat/proc/loadavg # view the system load
Disk and partition # mount | column-t # view the status of the mounted partition # fdisk-l # view all partitions # swapon-s # view all swap partitions # hdparm-I/dev/hda # view disk parameters (only applicable to IDE devices) # dmesg | grep IDE # view the IDE Device Detection Status at startup Network # ifconfig # view the attributes of all network interfaces # iptables-L # view firewall settings # route-n # view route 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 # real-time display Process status user # w # view active users # id <User Name> # view specified user information # last # view User Logon logs # cut-d: -f1/etc/passwd # view all users in the system # cut-d:-f1/etc/group # view all groups in the system # crontab-l # view the scheduled tasks of the current user
Service # chkconfig -- list # list all system services # chkconfig -- list | grep on # list all started system service programs # rpm-qa # view all installed software packages on the terminal of www.2cto.com linux, there is no graphic interface tool as useful as windows Search, but the find command is indeed very powerful. For example, you can use find/-name targetfilename to find a file by name. Alas, if you only know the name and the location, this is also a brutal and effective method.
The parameter-atime access time-ctime indicates the time when the status is changed-the time when the mtime is modified. Note that the time here is in 24 hours. After you view the man manual, you will be confused:-mtime n: File <A1> <AF> s data was last modified n * 24 hours ago. literally, it is the last modification of the file that occurred n 24 hours ago, but in fact find. /-mtime 0: returns the file modified in the last 24 hours.
Find./-mtime 1: the first 48 ~ Files modified within 24 hours. Instead of files modified within 48 hours. What files have been modified in the last 10 days? Find also supports expression relational operations, so we can add up the data of the last few days day by day: find./-mtime 0-o-mtime 1-o-mtime 2 ...... Although it is relatively earthy, it is also a method. There is no better way, I want to know... In addition, the-mmin parameter-cmin/-amin is similar.

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.