Java development must-have Linux commands

Source: Internet
Author: User

As a Java developer, some common Linux commands must be mastered. Linux (Unix) or Mac systems are not used in the development process, and Linux commands need to be mastered. Because many servers are Linux systems. Therefore, to interact with the server machine, it is necessary to pass the shell command.

This article does not explain all the commands in detail, only the common usage and explanations. You can use --help view Help or learn directly from Google search.

1. finding files Find/-name filename.txt Search by name/the filename.txt file under the directory. Find. -name "*.xml"recursively find all the XML files in Find.-name "*.xml" |xargs grep "Hello World"recursively find XML files with Hello World in all file contents grep-H ' Spring ' *. XML lookup so there are XML files containing spring find./-size 0 | Xargs Rm-f &Delete files with zero file size ls-L | grep '. Jar 'Find all jar files in the current directory grep' Test ' d*displays all rows that contain test in a file that begins with D. grep' Test 'The AA bb cc Displays the line that matches test in the aa,bb,cc file. grep' [A-z]\{5\} 'AA Displays all lines that contain a string of 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 Tomcat3. Terminate thread Kill-9 19979process that terminates thread number bit 199794. viewing files, including hidden files ls-Al5. Current working directory PWD6. copy files cp source dest copy file CP-r sourcefolder targetfolder recursively copy entire folder SCP sourecfile [email protected]:remoteaddr remote Copy7. Create directory mkdir NewFolder8. Delete directory rmdir deleteemptyfolder Delete empty directory rm-RF DeleteFile recursively deletes all contents in the directory9. moving files mv/temp/movefile/TargetFolder10. Re-command MV Oldnamefile Newnamefile11. Switch User su-username12. modify file Permissions chmod777 File.java//File.java permission-rwxrwxrwx,r means read, w indicates write, X is executable13. compress file Tar-CZF Test.tar.gz/test1/test214. List compressed file lists tar-Tzf test.tar.gz15. Unzip the file tar-Xvzf test.tar.gz16. View file header 10 lines head-N 10Example.txt17. View end of file 10 lines tail-N 10Example.txt18. View log type files tail-F Exmaple.log//This command automatically displays what's new, and the screen displays only 10 lines of content (can be set). 19. Use Super administrator to execute commands sudo rm a.txt Delete files with administrator status20. View port occupancy netstat-tln | grep 8080viewing usage of port 808021st. See which program the port belongs to Lsof-i:808022. View process PS aux|grep java View Java process PS aux view all Processes23. List the contents of the directory in a tree view24. File Download wget http://file.tgzCurl http://file.tgz25. Network Detection ping Www.just-ping.com26. telnet to ssh [email protected]27. Print information echo $JAVA _home Print the value of the JAVA HOME environment variable28. Java Common Commands Java Javac JPS, Jstat, Jmap, Jstack

Java development must-have Linux commands

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.