How to view logs in linux (Common commands)

Source: Internet
Author: User

How to view logs in linux (Common commands)

Cat

Tail-f

Japanese text description

 
 
  1. /Var/log/message information and error logs after the system is started. It is one of the most common logs in Red Hat Linux.
  2. /Var/log/secure security-related log information
  3. /Var/log/maillog and mail-related log information
  4. /Var/log/cron log information related to scheduled tasks
  5. /Var/log/spooler logs related to UCP and news Devices
  6. /Var/log/boot. log daemon starts and stops related log messages

System:

 
 
  1. # Uname-a # view kernel/operating system/CPU Information
  2. # Cat/etc/issue
  3. # Cat/etc/redhat-release # view the operating system version
  4. # Cat/proc/cpuinfo # view CPU Information
  5. # Hostname # view the computer name
  6. # Lspci-TV # list all PCI devices
  7. # Lsusb-TV # list all USB devices
  8. # Lsmod # list loaded Kernel Modules
  9. # Env # view environment variables

Resource:

 
 
  1. # Free-m # view memory usage and swap zone usage
  2. # Df-h # view the usage of each partition
  3. # Du-sh <Directory Name> # view the size of a specified directory
  4. # Grep MemTotal/proc/meminfo # view total memory
  5. # Grep MemFree/proc/meminfo # view the Amount of idle memory
  6. # Uptime # view system running time, number of users, and load
  7. # Cat/proc/loadavg # view system load

Disks and partitions:

 
 
  1. # Mount | column-t # view the status of the mounted Partition
  2. # Fdisk-l # view all partitions
  3. # Swapon-s # view all swap partitions
  4. # Hdparm-I/dev/hda # view disk parameters (only applicable to IDE devices)
  5. # Dmesg | grep IDE # view the IDE Device Detection Status at startup

Network:

 
 
  1. # Ifconfig # view the attributes of all network interfaces
  2. # Iptables-L # view firewall settings
  3. # Route-n # view the route table
  4. # Netstat-lntp # view all listening ports
  5. # Netstat-antp # view all established connections
  6. # Netstat-s # view network statistics

Process:

 
 
  1. # Ps-ef # view all processes
  2. # Top # display Process status in real time in another article)

User:

 
 
  1. # W # view active users
  2. # Id <User Name> # view specified user information
  3. # Last # view User Logon logs
  4. # Cut-d:-f1/etc/passwd # view all users in the system
  5. # Cut-d:-f1/etc/group # view all groups in the system
  6. # Crontab-l # view the scheduled tasks of the current user

Service:

 
 
  1. # Chkconfig-list # list all system services
  2. # Chkconfig-list | grep on # list all started system services

Program:

 
 
  1. # Rpm-qa # view all installed software 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.