Linux common commands (2) _ basic commands

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/qq_36209121/article/details/91128533

A. View port

# 查看当前所有tcp端口·
netstat -ntlp   

# 查看所有9000端口使用情况·
netstat -ntulp |grep 9000   

# 查看所有3306端口使用情况·
netstat -an | grep 3306 

-a : 显示所有连线中的Socket
-t : tcp链接
-u : udp链接
-n : 直接使用ip地址,而不通过域名服务器
-l : 显示监控中的服务器的Socket
-p : 显示正在使用Socket的 程序识别码(PID) 和 程序名称

II. View space

#显示空间使用量;
df -h  

#查看当前目录的使用情况
du -sh ./*  

III. Timing task

# 显示
crontab -l

# 编辑
crontab -e  

IV. File execute permission

chmod 777 ./start.sh

V. View md5 file

md5sum 文件名称

VI. Archive related

tar -zxvf fileName.tar

VII. Find

# 在目录下找名字为text.txt的文件;
find /home/test -iname "test.txt" 

#查找目录下大于100M的文件;
find /home/test -isize +100M 

# 查找文件, 比find快因为他搜索的是一个数据库索引, 
# 会定时更新, 所以新建的文件可能没有;
locate a.txt 

Eight. Curl

curl http://127.0.0.1:8080/test/demo/html -X POST -d 'name=test&age=2' 
-H 'Authorization:Bearer id2349098sd' -d

-X 请求的方法;
-d post请求的数据
-H 自定义header;

Guess you like

Origin blog.csdn.net/qq_36209121/article/details/91128533