1. Find Files
filename.txt files by name lookup/directory.
The code is as follows:
Recursively find all the XML files
The code is as follows:
Find. -name "*.xml" |xargs grep "Hello World"
Recursively find the XML file containing Hello World in all file contents
The code is as follows:
Find some XML files that contain spring
The code is as follows:
Find./-size 0 | Xargs Rm-f &
Delete a file with a file size of zero
The code is as follows:
Find all jar files in the current directory
The code is as follows:
Displays the rows that contain test in all files that start with D.
The code is as follows:
Displays the row that matches test in the aa,bb,cc file.
The code is as follows:
Displays all the lines that contain at least 5 consecutive lowercase characters for each string.
2. See if a program is running
View all processes related to Tomcat
3. Terminate the thread
Terminating the process of thread number bit 19979
4. View files, including hidden files
5. Current working directory
6. Copy files
Copying files
The code is as follows:
Cp-r Sourcefolder TargetFolder
Recursively copy an entire folder
The code is as follows:
SCP Sourecfile romoteusername@remoteip:remoteaddr
Remote Copy
7. Create a table of contents
8. Delete Directory
Delete Empty Directory
The code is as follows:
Recursively deletes all content in a directory
9. Moving files
Mv/temp/movefile/targetfolder
10. Renaming
MV Oldnamefile Newnamefile
11. Switch Users
12. Modify File Permissions
chmod 777 File.java File.java
The permissions-rwxrwxrwx,r the Read, W, and X represents the executable
13. Compressed Files
Tar-czf Test.tar.gz/test1/test2
14. List Compressed Files
15. Extract Files
16. View the first 10 lines of the file
17. View the end of the file 10 lines
18. View Log type File
This command automatically displays the new content, and the screen displays only 10 lines of content (can be set).
19. Execute command using Super admin status
To delete a file by using administrator identity
20. View Port occupancy
View usage of port 8080
21. See which program the port belongs to
22. View Process
View Java processes
View All Processes
23. Listing the contents of a directory in a tree chart
24. File download
wget http://file.tgz
Curl Http://file.tgz
25. Network detection
26. Remote Logins
27. Print information
Print the value of a Java home environment variable