Performance Tuning “lsof” command in Linux

Posted: September 6, 2013 in IOSTAT, Performance Tune

1. List all Open Files with lsof Command



Sections and it’s values are self-explanatory. However, we’ll review FD & TYPE columns more precisely.

FD – stands for File descriptor and may seen some of the values as:

  1. cwd current working directory
  2. rtd root directory
  3. txt program text (code and data)
  4. mem memory-mapped file

Also in FD column numbers like 1u is actual file descriptor and followed by u,r,w of it’s mode as:

  1. r for read access.
  2. w for write access.
  3. u for read and write access.

TYPE – of files and it’s identification.

  1. DIR – Directory
  2. REG – Regular file
  3. CHR – Character special file.
  4. FIFO – First In First Out

2. List User Specific Opened Files




3. Find Processes running on Specific Port




4. List Only IPv4 & IPv6 Open Files






5. List Open Files of TCP Port ranges 1-1024




6. Exclude User with ‘^’ Character



7. Find Out who’s Looking What Files and Commands?




8. List all Network Connections




9. Search by PID


10. List all TCP or UDP connections





Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.