Crontab: Task Scheduler
-e: Create and edit the crontab configuration file, the file is automatically installed when the edit is finished
-L: Display the contents of the Crontab configuration file on the standard input device
-r: Delete crontab configuration file
Five fields: Minute, time, day, month, week
eg
Empty/var/log/champly.log log 1:20 A.M. every day
1 * * * echo "0" >/var/log/champly.log
Execute every 8 hours ...
0 */8 * * * ...
Anacron: Same as Crontab
NTSYSV: Can see the list of services
If the command is not installed using yuminstall-y NTSYSV
Chkconfig:
Chkconfig--list: Viewing the operation of various system operating levels
Chkconfig--level [345] ServiceName on/off:
Turn services on or off at a certain run level, default 345
Chkconfig--add/del ServiceName: Add your own startup script
Under/ETC/INIT.D this folder
Linux system logs:
/etc/rsyslog.conf: Configuration file, see where the log is placed, it is best to use the default
/var/log/messages: Core System log files
Archive one log per week
/etc/cron.daily/logrotate Configuration Archive
/etc/logrotate.conf:
Messages is generated by the syslog: This daemon, if this service is stopped, the system will not produce/var/log/messages
/VAR/LOG/WTMP: Store User Login History last
Last: User can log in history
If it's deleted, last is gone.
/VAR/LOG/BTMP: Store Invalid login history
LASTB Viewing Invalid login history
/var/log/maillog: Log Mail logs
/var/log/secure: Security-related logs
/VAR/LOG/DMESG: Storage System boot hardware thrown log, reboot once, rewrite once
dmesg : Check the kernel error log (can see if the attack, whether overflow ...) )
What's the first thing to think about is to check the system log, to know exactly where the problem
Exec:
EXEC must be used in conjunction with find:
Use the {} instead of each file found in Find as an object
must be added after \; (the semicolon obtained by escaping)
Find files with the current directory creation time greater than 10 days and delete:
Find. -mtime +10-exec rm-rf {} \;
To change file names in bulk:
Find./*-exec mv {} {}_bak \;
Xargs used behind the pipe symbol
Find. –mtime +10 | Xargs RM-RF
ls-d./* | Xargs-i {} mv {} {}_bak
Can turn multiline into one line ls | Xargs
Screen
Installation via Yum install-y screen
Allows the program to log logs in the background
Use screen to start a shell, even if the current link is closed, the program can run the end of the
Equivalent to a child shell
Screen-ls: can see ID number
Screen-r ID/Name: can be counted into a screen
Screen-s (UPPERCASE) Name: You can customize a name
Curl: You can access a website in the command window, out of an HTML source
-I: Can look at head
-X: You can specify a proxy
/etc/hosts can set the host
-V: You can view the procedure
-U user:password: Specify user name and password access
-o filename URL: The name of the specified file can be downloaded
-o URL: Do not specify a name, the name is the real name
Ping: Testing the connectivity of the network
-C: You can specify the number
Telnet: Testing the connectivity of the port
Traceroute: As with Windows tracert, you can see what's wrong with the route.
Dig URL: You can see the domain name and IP equivalent to Windows nslookup
@dns: You can specify a DNS
Nc-z-w2 URL Port1-port2: Can scan ports open from Port 1 to Port 2
-Z: Show results, no display
-w2:2 seconds Timeout
SS: Similar to netstat in Windows, see Open ports
April 20, 2015
By:champly
Linux Learning Notes (System daily management-3)