1. See if a program is running
|
ps –ef| grep tomcat 查看所有有关tomcat的进程 |
2. Terminating a thread
3. View files, including hidden files
4. Current working directory
5. Copying files
|
cp source dest 复制文件 cp -r sourceFolder targetFolder 递归复制整个文件夹 scp sourecFile [email protected]:remoteAddr 远程拷贝 |
6. Create a Directory
7. Deleting a directory
|
rmdir deleteEmptyFolder 删除空目录 rm -rf deleteFile 递归删除目录中所有内容 |
8. Move files
|
mv /temp/movefile /targetFolder |
9. Re-order
|
mv oldNameFile newNameFile |
10. Switch users
11. Modify File Permissions
|
chmod 777 file .java //file .java的权限-rwxrwxrwx,r表示读、w表示写、x表示可执行 |
12. Compressing files
|
tar -czf test . tar .gz /test1 /test2 |
13. List Compressed Files
14. Extracting Files
16. View file Header 10 lines
17. View the end of the file 10 lines
18. View the log type file
1 |
tail -f exmaple.log // 这个命令会自动显示新增内容,屏幕只显示10行内容的(可设置)。 |
19. Execute commands with Super Administrator status
20. View Port Usage
|
netstat -tln | grep 8080 查看端口8080的使用情况 |
21. See which program the port belongs to
22. View the process
|
ps aux| grep java 查看java进程 ps aux 查看所有进程 |
23. List the contents of the directory in a tree view
Ps:mac using the tree command
24. File download
|
wget http: //file .tgz curl http: //file .tgz |
Install wget command under Mac
25. Network detection
26. Telnet
27. Printing information
|
echo $JAVA_HOME 打印java home环境变量的值 |
28.java Common Commands
Java Javac JPS, Jstat, Jmap, Jstack
29. Other Commands
Common shell commands