# lsof | grep TCP portmap 2587 rpc 4u IPv4 5544 TCP *:sunrpc (LISTEN) rpc.statd 2606 root 6u IPv4 5585 TCP *:668 (LISTEN) sshd 2788 root 3u IPv6 5991 TCP *:ssh (LISTEN) sendmail 2843 root 4u IPv4 6160 TCP badhd:smtp (LISTEN) vsftpd 9337 root 3u IPv4 34949 TCP *:ftp (LISTEN) cupsd 16459 root 0u IPv4 41061 TCP badhd:ipp (LISTEN)
Here’s a short list of useful Linux shell programs, many of which you may have never known about. I’ve got a new favorite shell command, lsof (shown above), which displays information on every open file handle. – Link.
If I could add one to the list, it’d have to be the short and sweet command line search and replace using perl:
perl -pi -e 's/searchpattern/replacewith/g' *.html
Do you have a favorite command line secret? Please share it in the comments.
ADVERTISEMENT