两个命令输出

netstat并不总是以类似的方式运行。原来使用三个命令(netstat后跟grep,后跟grep)是浪费管道
.

0

linux命令:lsof -i :80 | tee /dev/stderr | wc -l -l wc | /dev/stderr tee | :80 -i lsof lsof -i :80 | tee /dev/stderr | wc -lrootopen.com
linux命令:lsof -i :80 | tee /dev/stderr | wc -l -l wc | /dev/stderr tee | :80 -i lsof lsof -i :80 | tee /dev/stderr | wc -lrootopen.com
ulsi 2018-01-25 07:30:48
输出
linux命令:lsof 详解

评论

相关推荐

linux命令:lsof -i -nlP | awk '{print $9, $8, $1}' | sed 's/.*://' | sort -u -u sort | 's/.*://' sed | $1}' $8, $9, '{print awk | -nlP -i lsof lsof -i -nlP | awk '{print $9, $8, $1}' | sed 's/.*://' | sort -urootopen.com
linux命令:lsof -i -nlP | awk '{print $9, $8, $1}' | sed 's/.*://' | sort -u -u sort | 's/.*://' sed | $1}' $8, $9, '{print awk | -nlP -i lsof lsof -i -nlP | awk '{print $9, $8, $1}' | sed 's/.*://' | sort -urootopen.com
.

lsof命令显示与进程打开的文件相关的信息。文件可以是任何类型,包括常规文件,目录,块特殊文件,字符特殊文件,执行文本引用,库和流/网络文件。 要查看特定用户进程打开的文件,请键入以下命令。

linux命令:lsof -u tecmint tecmint -u lsof lsof -u tecmintrootopen.com
linux命令:lsof -u tecmint tecmint -u lsof lsof -u tecmintrootopen.com
.

使用lsof列出打开的网络连接(文件描述符),仅对那些处于已建立状态的人进行grepping

linux命令:lsof -i -n | grep ESTABLISHED ESTABLISHED grep | -n -i lsof lsof -i -n | grep ESTABLISHEDrootopen.com
linux命令:lsof -i -n | grep ESTABLISHED ESTABLISHED grep | -n -i lsof lsof -i -n | grep ESTABLISHEDrootopen.com
.

linux命令:lsof -u www-data www-data -u lsof lsof -u www-datarootopen.com
linux命令:lsof -u www-data www-data -u lsof lsof -u www-datarootopen.com
.

linux命令:lsof | grep "/var/spool/mail/" "/var/spool/mail/" grep | lsof lsof | grep "/var/spool/mail/"rootopen.com
linux命令:lsof | grep "/var/spool/mail/" "/var/spool/mail/" grep | lsof lsof | grep "/var/spool/mail/"rootopen.com
.

是否已登录到* nix框并需要知道哪个Web服务器正在运行以及所有当前的access_log文件在哪里?运行这一个班轮找出来。只要CustomLog名称有点标准,就适用于Apache或Lighttpd。提示:作为for循环的输入很好用,如下所示:for I in`lsof -p $(netstat -ltpn | awk'$ 4〜/:80 $ / {print substr($ 7,1,index($ 7,“/”) )-1)}')| awk'$ 9〜/access.log$/ {print $ 9 | “sort -u”}'`;做echo $ i; doneVery对于在不熟悉的服务器上进行分类很有用!

linux命令:lsof -p $(netstat -ltpn|awk '$4 ~ /:80$/ {print substr($7,1,index($7,"/")-1)}')| awk '$9 ~ /access.log$/ {print $9| "sort -u"}' -u"}' "sort $9| {print /access.log$/ ~ '$9 awk substr($7,1,index($7,"/")-1)}')| {print /:80$/ ~ '$4 -ltpn|awk $(netstat -p lsof lsof -p $(netstat -ltpn|awk '$4 ~ /:80$/ {print substr($7,1,index($7,"/")-1)}')| awk '$9 ~ /access.log$/ {print $9| "sort -u"}'rootopen.com
linux命令:lsof -p $(netstat -ltpn|awk '$4 ~ /:80$/ {print substr($7,1,index($7,"/")-1)}')| awk '$9 ~ /access.log$/ {print $9| "sort -u"}' -u"}' "sort $9| {print /access.log$/ ~ '$9 awk substr($7,1,index($7,"/")-1)}')| {print /:80$/ ~ '$4 -ltpn|awk $(netstat -p lsof lsof -p $(netstat -ltpn|awk '$4 ~ /:80$/ {print substr($7,1,index($7,"/")-1)}')| awk '$9 ~ /access.log$/ {print $9| "sort -u"}'rootopen.com
.

我想我可以减少这里的管道数量,有什么建议吗?

linux命令:lsof | awk '{print $1}' | sort | uniq -c | sort -rn | head head | -rn sort | -c uniq | sort | $1}' '{print awk | lsof lsof | awk '{print $1}' | sort | uniq -c | sort -rn | headrootopen.com
linux命令:lsof | awk '{print $1}' | sort | uniq -c | sort -rn | head head | -rn sort | -c uniq | sort | $1}' '{print awk | lsof lsof | awk '{print $1}' | sort | uniq -c | sort -rn | headrootopen.com
.

linux命令:lsof -i :80 :80 -i lsof lsof -i :80rootopen.com
linux命令:lsof -i :80 :80 -i lsof lsof -i :80rootopen.com
.

列出进程正在使用的文件。

linux命令:lsof +p xxxx xxxx +p lsof lsof +p xxxxrootopen.com
linux命令:lsof +p xxxx xxxx +p lsof lsof +p xxxxrootopen.com
.

该命令将使用目录终止所有进程。它很快,很脏。如果定期杀死不起作用,也可以使用-9杀死。如果需要卸载目录,这非常有用。

linux命令:lsof|grep /somemount/| awk '{print $2}'|xargs kill kill $2}'|xargs '{print awk /somemount/| lsof|grep lsof|grep /somemount/| awk '{print $2}'|xargs killrootopen.com
linux命令:lsof|grep /somemount/| awk '{print $2}'|xargs kill kill $2}'|xargs '{print awk /somemount/| lsof|grep lsof|grep /somemount/| awk '{print $2}'|xargs killrootopen.com
.

如果你的客户删除了一个进程正在使用的文件,那么这个空间不会被释放(不会在df中显示),直到该进程自行关闭文件或被终止。

linux命令:lsof | egrep "^COMMAND|deleted" "^COMMAND|deleted" egrep | lsof lsof | egrep "^COMMAND|deleted"rootopen.com
linux命令:lsof | egrep "^COMMAND|deleted" "^COMMAND|deleted" egrep | lsof lsof | egrep "^COMMAND|deleted"rootopen.com
.

linux命令:lsof -P | grep ':3000' ':3000' grep | -P lsof lsof -P | grep ':3000'rootopen.com
linux命令:lsof -P | grep ':3000' ':3000' grep | -P lsof lsof -P | grep ':3000'rootopen.com
.

有时候你需要使用一个已经被某个程序打开的端口,并且你不知道为了发布而杀掉谁 - 所以,现在你做了!

linux命令:lsof -i tcp:80 tcp:80 -i lsof lsof -i tcp:80rootopen.com
linux命令:lsof -i tcp:80 tcp:80 -i lsof lsof -i tcp:80rootopen.com
.

列出由特定进程ID打开的所有文件。 “PID”

linux命令:lsof -p 15857 15857 -p lsof lsof -p 15857rootopen.com
linux命令:lsof -p 15857 15857 -p lsof lsof -p 15857rootopen.com
.

根据命令名列出由特定命令打开的所有文件。

linux命令:lsof -c dhcpd dhcpd -c lsof lsof -c dhcpdrootopen.com
linux命令:lsof -c dhcpd dhcpd -c lsof lsof -c dhcpdrootopen.com
.

linux命令:lsof -i -i lsof lsof -irootopen.com
linux命令:lsof -i -i lsof lsof -irootopen.com
.

linux命令:lsof -i | grep -i estab estab -i grep | -i lsof lsof -i | grep -i estabrootopen.com
linux命令:lsof -i | grep -i estab estab -i grep | -i lsof lsof -i | grep -i estabrootopen.com
.

将24073更改为您的pid

linux命令:lsof -nP +p 24073 | grep -i listen | awk '{print $1,$2,$7,$8,$9}' $1,$2,$7,$8,$9}' '{print awk | listen -i grep | 24073 +p -nP lsof lsof -nP +p 24073 | grep -i listen | awk '{print $1,$2,$7,$8,$9}'rootopen.com
linux命令:lsof -nP +p 24073 | grep -i listen | awk '{print $1,$2,$7,$8,$9}' $1,$2,$7,$8,$9}' '{print awk | listen -i grep | 24073 +p -nP lsof lsof -nP +p 24073 | grep -i listen | awk '{print $1,$2,$7,$8,$9}'rootopen.com
.

我更喜欢使用这个而不是-n多种,所以我得到DNS解析的主机名。很好,当我试图找出谁有这个端口打开。

linux命令:lsof -i -i lsof lsof -irootopen.com
linux命令:lsof -i -i lsof lsof -irootopen.com
.

linux命令:lsof |awk ' {if ( $0 ~ /home/) print substr($0, index($0,"/home") ) }'|cut -d / -f 1-4|sort|uniq -c|sort -bgr -bgr -c|sort 1-4|sort|uniq -f / -d }'|cut ) index($0,"/home") substr($0, print /home/) ~ $0 ( {if ' |awk lsof lsof |awk ' {if ( $0 ~ /home/) print substr($0, index($0,"/home") ) }'|cut -d / -f 1-4|sort|uniq -c|sort -bgrrootopen.com
linux命令:lsof |awk ' {if ( $0 ~ /home/) print substr($0, index($0,"/home") ) }'|cut -d / -f 1-4|sort|uniq -c|sort -bgr -bgr -c|sort 1-4|sort|uniq -f / -d }'|cut ) index($0,"/home") substr($0, print /home/) ~ $0 ( {if ' |awk lsof lsof |awk ' {if ( $0 ~ /home/) print substr($0, index($0,"/home") ) }'|cut -d / -f 1-4|sort|uniq -c|sort -bgrrootopen.com
.
共收录0条命令行
这里是记录和分享命令行的地方, 所有命令行都可以进行评论、提交替代方案.

推荐
    热门命令