Java developer must-have Linux commands

Source: Internet
Author: User

Beijing Shang Academy offers

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. Find Files

find / -name filename.txtFind the Filename.txt file under the name/directory.

find . -name "*.xml"Recursive lookup of all XML files

find . -name "*.xml" |xargs grep "hello world"Recursively find XML files with Hello World in all file contents

grep -H ‘spring‘ *.xmlFind so some XML file that contains spring

find ./ -size 0 | xargs rm -f &Delete files with a file size of zero

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‘ aa bb ccDisplays the line that matches test in the aa,bb,cc file.

grep ‘[a-z]\{5\}‘ aaDisplays all rows that contain a string of at least 5 consecutive lowercase characters for each string.

2. See if a program is running

ps –ef|grep tomcatSee all processes related to Tomcat

3. Terminating a thread

kill -9 19979Thread that terminates thread number bit 19979

4. View files, including hidden files

ls -al

5. Current working directory

pwd

6. Copying files

cp source destCopying files

cp -r sourceFolder targetFolderRecursively copy entire folders

scp sourecFile [email protected]:remoteAddrRemote Copy

7. Create a Directory

mkdir newfolder

8. Deleting a directory

rmdir deleteEmptyFolderDelete Empty directory rm -rf deleteFile recursively delete all contents in directory

9. Move files

mv /temp/movefile /targetFolder

10. Re-order

mv oldNameFile newNameFile

11. Switch Users

su -username

12. Modify File Permissions

chmod 777 file.javaFile.java permission-rwxrwxrwx,r means read, w indicates write, X is executable

13. Compressing files

tar -czf test.tar.gz /test1 /test2

14. List Compressed Files

tar -tzf test.tar.gz

15. Extracting Files

tar -xvzf test.tar.gz

16. View file Header 10 lines

head -n 10 example.txt

17. View the end of the file 10 lines

tail -n 10 example.txt

18. View the log type file

tail -f exmaple.logThis command automatically displays what's new, and the screen displays only 10 lines of content (can be set).

19. Execute commands with Super Administrator status

sudo rm a.txtDelete Files using administrator

20. View Port Usage

netstat -tln | grep 8080Viewing usage of port 8080

21. See which program the port belongs to

lsof -i :8080

22. View the process

ps aux|grep javaView Java processes

ps auxView All Processes

23. List the contents of the directory in a tree view

tree a

Ps:mac using the tree command

24. File download

wget http://file.tgzInstall wget command under Mac

curl http://file.tgz

25. Network detection

ping www.taobao.com

26. Telnet

ssh [email protected]

27. Printing information

echo $JAVA_HOMEPrint the value of the Java Home environment variable

28.java Common Commands

Java Javac JPS, Jstat, Jmap, Jstack

29. Other Commands

SVN git maven

28.linux Command Learning site:

http://explainshell.com/

Resources:

The Linux port is occupied with the resolved (Error:jboss port is in use. Please check)

Powerful and common commands in Linux: Find, grep

Linux commands

Welcome to add! ~

Beijing Shang Academy-CCTV CCTV net Advertising partners, professional Java training institutions, best-in-word Java training, iOS training, Android training, Hadoop Big Data training, Web front end, 0 yuan admission, first post-employment payment, average employment salary above 9500

Java developer must-have Linux commands

Related Article

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.