Java development will be the Linux command _java

Source: Internet
Author: User

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

Ls-al

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

Su-username

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

Tar-tzf test.tar.gz

15. Extract Files

Tar-xvzf test.tar.gz

16. View the first 10 lines of the file

Head-n Example.txt

17. View the end of the file 10 lines

Tail-n Example.txt

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

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.