运维常用命令(二)

2017-10-16  本文已影响28人  大富帅

curl POST请求

-H "Content-Type: application/x-www-form-urlencoded"
-H "Content-Type: application/json"
-H "Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryrGKCBY7qhFd3TrwA"

refer: http://blog.csdn.net/hqzxsc2006/article/details/50547684

DNS查询

dig +trace @8.8.8.8 math.stackexchange.com 详细查询

dig notifier.ouwan.com  txt 
# notifier.ouwan.com.   599 IN  TXT "v=spf1 ip4:106.75.166.110 ~all" 
dig notifier.ouwan.com  mx 
# notifier.ouwan.com.   484 IN  MX  5 106.75.166.110.

nslookup
nslookup -q=txt notifier.ouwan.com 8.8.8.8

git 查看拉下来的文件有那些具体的修改

git diff HEAD^

Screen 常用用法

pip 强制更新

sudo pip install awscli --force-reinstall --upgrade

lsof

#  列出某个程序进程所打开的文件信息
lsof -c mysql  或者
lsof | grep mysql 

# 通过某个进程号显示该进行打开的文件
lsof -p 1,2,3

# 列出谁在使用某个端口
lsof -i :3306
lsof -i tcp:80
lsof -i udp:55

# 列出所有tcp 网络连接信息
lsof -i tcp
lsof -i udp

# 列出进程某个TCP状态
lsof -a -i -s TCP:CLOSE_WAIT -p 11966

lsof lists all open file handlers for a process. Since everything in Linux is a file, you effectively get to see all open sockets, input/output streams, etc. that a process has open.
-p lists all the entries for a specific process ID
-i lists only network files open
-s lists the TCP or UDP state
-a requires all other parameters passed in to hold as true for a record to be displayed. Basically, it lets you filter based on the above properties.
上一篇下一篇

猜你喜欢

热点阅读