1. Linux system service Management
Tool NTSYSV similar to the graphical interface management tool, if no command is installed using Yum install-y NTSYSV
Common services: Crond, iptables, Network, sshd, Syslog, Irqbalance,sendmail, Microcode_ctl
Chkconfig--list
Chkconfig--add/del ServiceName
Chkconfig--level [345] ServiceName on/off
2. Linux system logs
/etc/rsyslog.conf (http://www.lishiming.net/thread-7260-1-1.html)
/var/log/messages Core System log files
Archive one log per week messages-20130901
/etc/logrotate.conf
Messages is generated by the syslogd daemon, and if this service is stopped, the system will not generate/var/log/messages
/var/log/wtmp View User Login history Last
/var/log/btmp LASTB View Invalid login history
/var/log/maillog
/var/log/secure
Dmesg
/var/log/dmesg
3. Exec and Xargs
Both exec and find use
Find files with the current directory creation time greater than 10 days and delete: Find. -mtime +10-exec rm-rf {} \;
Bulk Change file name: Find./*-exec mv {} {}_bak \;
Xargs used behind the pipe symbol
Find. -mtime +10 |xargs RM-RF
ls-d./* |xargs-n1-i{} MV {} {}_bak
Xargs can turn multiple lines into a row of cat 1.txt|xargs
4. Screen Tool Introduction
Screen is the equivalent of a virtual terminal, which does not exit due to network interruption, each login can enter the screen
How to use: Directly enter the screen command
Screen-ls View the screen that is already open
Ctrl +a then press D to exit the screen session, just exit, and not end. End words Enter Ctrl +d or enter exit
After exiting, you also want to log in to a screen session again, using Sreen-rscreenid if there is only one screen direct screen-r
Screen-s aming; login words screen-r aming
Screen-x-S ID number quit the Dead (Detached) screen
5. Learn to use the Curl command
Curl is a tool for simple testing of Web Access under the Linux system command line, with a few common options you need to master
Curl-xip:port www.baidu.com #-x can specify IP and port, omit write hosts, convenient and practical
Curl-iv http://www.qq.com #-I can drop the content of the access, only show the status code,-V can show the detailed process
Curl-u User:password http://123.com #-u can specify user name and password
Curl Http://study.lishiming.net/index.html-O #可以下载
You can also use the-O custom name
Curl-o index2.html http://study.lishiming.net/index.html
6. Several network-related commands
Ping
Telnet Www.lishiming.net 80
Traceroute www.baidu.com
Dig @8.8.8.8 study.lishiming.net
Nc-z-w2 www.baidu.com 1-1024 #-w2 indicates a 2s timeout port where you can write only one port, or write a range. When using the NC scan port, you must add-Z or the result will not be displayed. Also, if you want to display the ports that are not open, you can add a-V
SS command Usage (similar to netstat) http://www.ttlsa.com/linux-command/ss-replace-netstat/
May 10, 2016 curl,chkconfig