http//www.kancloud.cn/digest/javaxviii/1267811. finding files Find/-name filename.txt Search by name/the filename.txt file under the directory. Find. -name "*. xml "recursively finds all XML files for find.-name "*.xml" |xargs grep "Hello World" recursively looks up all the file contents of the XML file containing Hello world grep-H ' Spring ' *. XML lookup so there are XML files containing spring find./-size0| Xargs Rm-f &Delete files with zero file size ls-L |grep ' jar ' finds 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 cc shows the line matching test in the aa,bb,cc file. grep ' [A-z]/{5/} ' AA displays all rows that contain a string of at least 5 consecutive lowercase characters per string. 2. See if a program is running PS–EF|grep Tomcat View all processes related to Tomcat3. Terminate thread Kill-919979 thread that terminates thread number bit 199794. viewing files, including hidden files ls-Al5. Current working directory PWD6. copy files cp sourcefolder TARGETFOLDERSCP 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/TargetFolderTen. Re-command MV Oldnamefile Newnamefile One. Switch User su-username A. modify file Permissions chmod777File.java//File.java permission-rwxrwxrwx,r means read, w indicates write, X is executable -. compress file Tar-CZF Test.tar.gz/test1/test2 -. List compressed file lists tar-Tzf test.tar.gz the. Unzip the file tar-Xvzf test.tar.gz -. View file header 10 lines head-NTenExample.txt -. View end of file 10 lines tail-NTenExample.txt -. 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). +. Use Super administrator to execute commands sudo rm a.txt Delete files with administrator status -. View port occupancy netstat-tln |grep 8080 viewing usage of port 8080 +. See which program the port belongs to Lsof-I.:8080 A. View process PS aux|grep java View Java process PS aux view all Processes at. List contents in a tree chart using the tree command under the tree Aps:mac -. File Download wget http://file.tgzinstall wget Command Curl HTTP under Mac://file.tgz -. Network Detection ping www.taobao.com -. telnet to ssh [email protected] -. Print information echo $JAVA _home Print the value of the JAVA home environment variable -. Java Common Commands Java javacjps, Jstat, Jmap, Jstack in. Other commands svn git maven
Linux for Java Programer