1. See if a program is running
|
ps–ef|greptomcat 查看所有有关tomcat的进程 |
2. Terminating a thread
3. View files, including hidden files
4. Current working directory
5. Copying files
|
cpsource dest 复制文件cp -r sourceFolder targetFolder 递归复制整个文件夹scpsourecFile [email protected]:remoteAddr 远程拷贝 |
6. Create a Directory
7. Deleting a directory
|
rmdirdeleteEmptyFolder 删除空目录 rm-rf deleteFile 递归删除目录中所有内容 |
8. Move files
|
mv/temp/movefile/targetFolder |
9. Re-order
|
mvoldNameFile newNameFile |
10. Switch users
11. Modify File Permissions
|
chmod777 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 | grep8080 查看端口8080的使用情况 |
21. See which program the port belongs to
22. View the process
|
psaux|grep java 查看java进程psaux 查看所有进程 |
23. List the contents of the directory in a tree view
Ps:mac using the tree command
24. File download
|
wget http://file.tgzcurl 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