Commonly used commands to view log in CentOS system

Linux IDE RedHat firewall activity.
cat 
tail -f

Log file 
description /var/log/message Information and error logs after system startup, which is one of the most commonly used logs in Red Hat Linux 
/var/log/secure Security-related log information 
/var/log/maillog Mail-related Log information 
/var/log/cron Log information related to scheduled tasks 
/var/log/spooler Log information related to UUCP and news devices 
/var/log/boot.log Log information related to daemon start and stop


System: 
# uname -a # View kernel/OS/CPU information 
# cat /etc/issue 
# cat /etc/redhat-release # 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 
resources: 
# free -m # View memory usage and swap usage Volume 
# df -h # View the usage of each partition 
# du -sh <directory name> # View the size of the specified directory 
# grep MemTotal /proc/meminfo # View the total amount of memory 
# grep MemFree /proc/meminfo # View the amount of free memory 
# uptime # View system running time, number of users, load 
# cat /proc/loadavg # View system load 
disks and partitions: 
# mount | column -t # View mounted partition status 
# fdisk -l # View all partitions 
# swapon -s # View all swap partitions 
# hdparm -i /dev/hda # View disk parameters (only for IDE devices) 
# dmesg | grep IDE # View IDE device detection status at startup 
Network: 
# ifconfig # View properties of all network interfaces 
# iptables -L # View firewall Setting 
# 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 # Display process status in real time (detailed in another article) 
User: 
# w # View active users 
# id <username> # View specified user information 
# last # View user login log 
# 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 task 
services of the current user: 
# chkconfig –list # List all system services 
# chkconfig – list | grep on # List all started system service 
programs: 
# rpm -qa # View all installed packages

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326107515&siteId=291194637