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