Java developers use 19 most common Linux commands
1. Search for files
Find/-name filename.txt
Find the filename.txt file under/directory by name.
2. check whether a program is running
Ps-ef | grep tomcat
View All tomcat Processes
3. Terminate the thread
Kill-9 19979
Terminate the thread with the thread number 19979
4. view files, including hidden files
Ls-al
5. current working directory
Pwd
6. Copy files, including their subfiles, to the custom directory.
Cp-r sourceFolder targetFolder
7. Create a directory
Mkdir newfolder
8. Delete the directory (this directory is empty)
Rmdir deleteEmptyFolder
9. delete files including their subfiles
Rm-rf deleteFile
10. Move files
Mv/temp/movefile/targetFolder
Extension rename mv oldNameFile newNameFile
11. Switch users
Su-username
12. Modify file permissions
Chmod 777 file. java
// File. java permission-rwxrwxrwx, r indicates read, w indicates write, and x indicates executable
13. compressed file
Tar-czf test.tar.gz/test1/test2
14. List compressed files
Tar-tzf test.tar.gz
15. decompress the file
Tar-xvzf test.tar.gz
16. view the first 10 lines of the file
Head-n 10 example.txt
17. View 10 lines at the end of the file
Tail-n 10 example.txt
18. view log files
Tail-f exmaple. log
// This command will automatically display the new content. The screen will display only 10 lines of content (configurable ).
19. Start the Vi editor.
Vi