- Linux Common commands
- PS Aux|grep xxx (such as PS Aux|grep Tomcat PS aux|grep tomcat-portalvip PS aux|grep nginx, etc.)
- Rpm-qa|grep XXX (Find system has not installed such as rpm-qa|grep MySQL rpm-qa|grep mysql rpm-qa|grep jdk etc.)
- Force uninstall RPM-E The previous step to find the contents of the results--nodeps
- To see if the port is occupied Netstat-an|grep port
- See which process the port is consuming Losf-i: port (yum-y install lsof if not)
- Most of the commands that are not indicated can be installed by Yum
- Top view CPU memory consumption such as TOP-H-p process ID can see the CPU memory consumption of the process thread of IO
- Free to view memory size
- DF-HL Viewing disk information
- Du-sh view current path lay Du-sh folder or file to view a folder or file size
- Uname-a viewing the operating system version
- Top check that some of the process is not normal if the struts vulnerability caused by the virus Trojan directly kill-9 off the process or pkill-9 keyword killed
- General boot files are in the/etc/init.d/directory poisoning backward to ll-t in reverse chronological order to see the next time ranking before the execution of the script is normal or delete directly
- RM and MV commands and their dangerous commands determine which files in that directory you can manipulate
- CP-RF depth Copy
- TAR-ZXVF xxx.tar.gz File
- Open large files do not use VI with more or less and so on or the memory of small files with VI
- Firewall in/etc/sysconfig/iptables
- Echo 3 >/proc/sys/vm/drop_caches Release System cache
- ====================================================================
========================== View Log ========================================,
Cat
Tail-f
Log file description
/var/log/message system startup information and error log, which is 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 information related to UUCP and news devices
/var/log/boot.log Daemon starts and stops related log messages
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 of loaded kernel modules
# env # View Environment variables
Resources:
# free-m # View memory usage and swap area usage
# df-h # View the usage of each partition
# du-sh < directory name > # View the size of the specified directory
# grep Memtotal/proc/meminfo # View Total Memory
# grep Memfree/proc/meminfo # View the amount of free memory
# uptime # View System uptime, number of users, load
# cat/proc/loadavg # View System load
Disks and partitions:
# Mount | COLUMN-T # Viewing the status of a mounted partition
# fdisk-l # View all partitions
# swapon-s # View all swap partitions
# hdparm-i/dev/hda # View disk parameters (for IDE devices only)
# DMESG | grep IDE # View IDE device detection status at startup
Internet:
# ifconfig # View the properties of all network interfaces
# iptables-l # View firewall settings
# route-n # View the 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 of process status (in another article there is a detailed introduction)
User:
# w # View active Users
# ID < user name > # view specified user information
# last # View user log in log
# cut-d:-f1/etc/passwd # View All users of the system
# cut-d:-f1/etc/group # View all system 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
====================== records some common Web service troubleshooting commands that are constantly updated. =============================
1. Check link availability and time consumption
Command
Curl-o/dev/null-s-W%{time_namelookup}::%{time_connect}::%{time_starttransfer}::%{time_total}::%{speed_download } "Http://www.taobao.com"
Results
0.008::0.039::0.076::0.140::306729.000
2. Statistics server link status
Command
Netstat-n | awk '/^tcp/{++s[$NF]} END {for (a in S) print A, s[a]} '
Results
Time_wait 814
Close_wait 1
Fin_wait1 1
Established 634
SYN_RECV 2
Last_ack 1
3. Open Python HTTP Service
Command
Python-m Simplehttpserver
4. Check Maven dependency conflicts
Command
Mvn-u Dependency:tree-dverbose
Results
[INFO] \-Qunar.tc:qmq-client:jar:1.2.11:compile
[INFO] +-(qunar.common:common-rpc:jar:8.0.7:compile-omitted for conflict with 7.0.9)
[INFO] +-Qunar.tc:qmq-common:jar:1.2.11:compile
[INFO] | +-(qunar.tc:qmq-api:jar:1.2.11:compile-omitted for duplicate)
[INFO] | +-(qunar.common:common-rpc:jar:8.0.7:compile-omitted for conflict with 7.0.9)