Linux view logs (common commands)

Source: Internet
Author: User

Cat
Tail-f
Log file description

/var/log/message system startup information and error logs are one of the most commonly used logs in red Hat Linux/var/log/secure Security-related log information/var/log/maillog message-related log information/var/log /cron log information related to timed tasks/var/log/spooler log messages related to UUCP and news devices/var/log/boot.log Daemon start and stop related log message


System:

# uname-a # View kernel/Os/cpu info # cat/etc/issue # cat/etc/redhat-release # view OS version # Cat/proc/cpuinfo # view CPU Info # Hostname # View Computer name # LSPCI-TV # list all PCI devices # LSUSB-TV # list all USB devices # lsmod # list loaded kernel modules # env # View Environment variables


Resources:

# free-m # View memory usage and swap usage # df-h # View each partition usage # du-sh < directory name > # View the size of the specified directory # grep memtotal/proc/meminfo # Check Look at the total memory # grep Memfree/proc/meminfo # View Idle amount # uptime # View System uptime, number of users, load # cat/proc/loadavg # View System load


Disks and partitions:

# Mount | Column-t # View attached partition status # fdisk-l # View all partitions # swapon-s # view all swap partitions # hdparm-i/DEV/HDA # View disk parameters (IDE devices only) # DME sg | grep IDE # View IDE Device detection status on startup network: # ifconfig # View all network Interface Properties # iptables-l # View firewall settings # route-n # View 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 # Real-time display process status


User:

# w # view active user # ID < username > # View specified user information # Last # View user log in log # cut-d:-F1/ETC/PASSWD # View system All users # cut-d:-f1 /etc/group # View system All groups # Crontab-l # View Current user's scheduled tasks


Service:

# chkconfig–list # List all system Services # Chkconfig–list | grep on # Lists all startup system services


Program:

# rpm-qa # View all installed Packages

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.