Linux command essay

Source: Internet
Author: User

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

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.