2015-04-20linux System daily Management 3

Source: Internet
Author: User

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
Added Linux new service to boot boot

such as Tomcat

Vim/etc/init.d/tomcat//Join from second line

    1. # chkconfig:2345 63 37

chmod 755/etc/init.d/tomcat

Chkconfig--add Tomcat
Chkconfig Tomcat on

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
Last/var/log/wtmp View User Login History
Lastb/var/log/btmp Viewing Invalid login history
/var/log/maillog Mail
/var/log/secure Login
/VAR/LOG/DMESG start
3. Exec and Xargs

Generate a. bak file

[email protected] sundong]# find/sd/sundong/-type f-mtime +1-exec cp {} {}.bak \;

Delete

[email protected] sundong]# find/sd/sundong/-type f-name "*.bak" |xargs RM-RF

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-r Screenid if there is only one screen direct screen-r
Screen-s aming; login words screen-r aming
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 Baidu.com

All I know about curl

Http://www.apelearn.com/bbs/forum.php?mod=viewthread&tid=7427&highlight=curl

6. Several network-related commands
PING specifies the source IP

Ping-i 116.211.95.148 58.53.94.11
Telnet Www.lishiming.net 80
Traceroute www.baidu.com
Dig @8.8.8.8 study.lishiming.net

yum install bind-utils
NC arbitrary TCP and UDP connection and monitoring
SS command Usage (similar to netstat) http://www.ttlsa.com/linux-command/ss-replace-netstat/
Expand your Learning Profile:
1. XINETD (the default machine does not install this service, requires Yum install xinetd installation) http://blog.sina.com.cn/s/blog_465bbe6b010000vi.html

Linux xinetd Service Introduction (GO) http://blog.sina.com.cn/s/blog_6ceed3280101jja0.html

2. Linux System log Special Http://tech.ccidnet.com/pub/imag ... uanti/log/index.htm
3. Xargs command http://blog.csdn.net/zhangfn2011/article/details/6776925

2015-04-20linux System daily Management 3

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.