Java developers use 19 most common Linux commands

Source: Internet
Author: User

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

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.