Instructions on small commands

Source: Internet
Author: User
In Linux, you can change the subdirectories and file permissions in a directory at one time.

Run the command: chmod-r a + rwx directory name

A indicates that the user has the read (R), write (w), and execute (x) permissions. + Adds a permission.-deletes the permission.

A can also be changed to Ugo. U indicates the owner of the file, G indicates that the owner of the file belongs to the same group, and O indicates that the owner of the file belongs to other people.

The R parameter is used to perform the same operation on sub-directories.

For example, chmod-r a + rwx/Web

Delete non-empty directory
The command rmdir cannot be used to delete non-empty directories. Use the command Rm-RF directory name.
Tar usage
Compressed directory
Tar-CVF mytar.tar/mytar
-C create
-X Extract
If you addZParameter.Tar.gzOr. TgzTo representGzipCompressedTar file~
If you addJParameter.Tar.bz2To serve as the attachment name ~


View the port-consuming process in Linux
Netstat-tlnp | grep Port

Tomcat startup, shutdown, and killing Processes

Open Terminal
CD/Java/tomcat
# Execution
Bin/startup. Sh # start Tomcat
Bin/shutdown. Sh # Stop Tomcat
Tail-F logs/Catalina. Out # view Tomcat console output;

# Check whether Tomcat is running
PS-Ef | grep Tomcat
# If yes, use kill;
Kill-9 pid # PID is the corresponding process number

For example, the pe-Ef | grep Tomcat output is as follows:

Sun 5144 1 0 00:00:06 pts/1/Java/JDK/bin/Java-djava. util. logging. manager = org. apache. juli. classloaderlogmanager-djava. endorsed. dirs =/Java/tomcat/common/endorsed-classpath:/Java/tomcat/bin/Bootstrap. jar:/Java/tomcat/bin/commons-logging-api.jar-dcatalina. base =/Java/tomcat-dcatalina. home =/Java/tomcat-djava. io. tmpdir =/Java/tomcat/temp Org. apache. catalina. startup. bootstrap start

Then 5144 is the process ID pid = 5144
Kill-9 5144 to completely kill Tomcat

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.