This article does not explain all the commands in detail, but gives common usage and explanations, using--help to view Help.
1. Find Files
Find/-name filename.txt based on name lookup/directory filename.txt files.
find.-name "*.xml" recursively finds all the XML files found
.-name "*.xml" |xargs grep "Hello World" recursively finds all file contents containing the Hello World XML file
grep-h ' Spring ' *.xml find some XML files that contain spring
./-size 0 | xargs rm-f & Delete Files of zero size
ls-l | grep ' jar ' Finds all jar files in the current directory
grep ' test ' d* shows all the rows in the file that start with D contain test.
grep ' test ' AA bb cc shows the row matching test in the aa,bb,cc file.
grep ' [a-z]\{5\} ' AA displays all the lines that contain at least 5 consecutive lowercase characters for each string.
2. See if a program is running
Ps–ef|grep Tomcat View all processes related to Tomcat
3. Terminate the thread
Kill-9 19979 terminating thread number 19979 thread
4. View files, including hidden files
5. Current working directory PWD
6. Copy files
CP sourcefolder TargetFolder
SCP sourecfile romoteusername@remoteip:remoteaddr remote Copy
7. Create directory mkdir newfolder
8. Delete Directory
RmDir deleteemptyfolder Delete Empty directory
rm-rf deletefile recursively delete all content in the directory
9. Moving files
Mv/temp/movefile/targetfolder
10. Heavy command
MV Oldnamefile Newnamefile
11. Switch Users
12. Modify File Permissions
chmod 777 File.java//file.java permission-rwxrwxrwx,r represents read, W represents write, X represents 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
Tail-f exmaple.log//This command will automatically display the new content, the screen displays only 10 lines of content (can be set).
19. Execute command using Super admin status
sudo rm a.txt Delete files using administrator identity
20. View Port occupancy
Netstat-tln | grep 8080 View use of port 8080
above 20 commands want to be proficient, I hope to help you with Java development helps