1. Check the size of each file and folder in the current directory: Du-sh *
2, the export file tree structure directory: tree/f >d:\a.txt
3, MEMCACHE
How to run Memcache
/usr/local/bin/memcached-d-M 10-u root-l 10.xx.xx.xx-p 12000-c 1024–p/tmp/memcached.pid
# # Related options Description
- D means to start a daemon
-M is the memory allocated to memcached use
-u user running memcached
-L is the IP of memcached monitoring
-P is the memcached listening port
-C memcache Maximum number of concurrent connections running
-P is a PID file that sets Memcache
4, the Linux alias effective setting
Add the alias definition to the. bashrc file in the/root directory.
5. Kill the Java process in bulk:
Ps-ef|grep java|grep-v grep|cut-c 9-15|xargs kill-9
6. Port conflicts
1). Find out which process is consuming port: NETSTAT-APN | grep port number, find the process number;
2). Find out which process is occupying: Ps-aux | grep process number;
To view the occupancy of an end port: lsof-i: Port number
7, Linux Server restart
Shutdown-r now
Reboot
Linux Server shutdown: shutdown-h now
8, modify the server time:
Date-s "20160311 08:59:10" &&hwclock--SYSTOHC
9, the Linux server connection is slow
Modify the/etc/ssh/sshd_config file to change #usedns Yes to Usedns No, then restart the SSH service, execute the command: service sshd restart
10, dynamic display of Linux server time: Watch-n 1 Date
11. Fuser-m-V Mount directory query which process is using mount
12. Delete files from 30 days ago:
Find/opt/logs-mtime +30-type F | Xargs RM-RF
13. New Linux User
useradd-d/opt/newuser NewUser Create a new NewUser user and build a folder with the same name in the/OPT directory
14, passwd newuser Modify user password
Linux command essay