{"id":1752,"date":"2022-10-15T12:30:00","date_gmt":"2022-10-15T17:30:00","guid":{"rendered":"https:\/\/www.linuxcloudvps.com\/blog\/?p=1752"},"modified":"2022-10-13T14:26:31","modified_gmt":"2022-10-13T19:26:31","slug":"10-useful-lsof-commands-in-linux-with-examples","status":"publish","type":"post","link":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-lsof-commands-in-linux-with-examples\/","title":{"rendered":"10 Useful lsof Commands in Linux With Examples"},"content":{"rendered":"\n<p>In this blog post, we are going to show you ten useful lsof commands in Linux with examples.<\/p>\n\n\n\n<p>The <strong>lsof<\/strong> command is a shortcut to List open files and shows the open files and which processes are using them. The lsof output describes several things, such as the identification number of the process that has opened the file, the process group identification number, the command the process is executing, the owner of the process, and many more.<\/p>\n\n\n\n<p>In this tutorial, <a href=\"https:\/\/www.rosehosting.com\/ubuntu-hosting\/\" title=\"\">we will use the latest Ubuntu 22.04<\/a> OS, but you can choose any Linux distro you want. Let&#8217;s get started!<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>A server with Ubuntu 22.04 OS<\/li><li>User privileges: root or non-root user with sudo privileges<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Update the System<\/h2>\n\n\n\n<p>If you have a fresh installation of Ubuntu 22.04, then it is recommended the system packages be updated to the latest versions available.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt update -y &amp;&amp; sudo apt upgrade -y<\/pre>\n\n\n\n<p>Once the system is updated, we are ready to show you the ten useful lsof commands in Linux.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. List all open files<\/h2>\n\n\n\n<p>The basic <strong>lsof<\/strong> command without any arguments will list all open files:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">lsof<\/pre>\n\n\n\n<p>The output is very long, and it should look like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">COMMAND     PID   TID TASKCMD               USER   FD      TYPE             DEVICE SIZE\/OFF       NODE NAME\nsystemd       1                             root  cwd       DIR              252,1     4096          2 \/\nsystemd       1                             root  rtd       DIR              252,1     4096          2 \/\nsystemd       1                             root  txt       REG              252,1  1849992      13141 \/usr\/lib\/systemd\/systemd\nsystemd       1                             root  mem       REG              252,1   149760        690 \/usr\/lib\/x86_64-linux-gnu\/libgpg-error.so.0.32.<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">2. Files accessed by a particular process<\/h2>\n\n\n\n<p>To list the files accessed by a particular process, execute the lsof command with the <strong>-c<\/strong> argument and the process name.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# lsof -c apache\nCOMMAND   PID     USER   FD      TYPE DEVICE SIZE\/OFF   NODE NAME\napache2 21922     root  cwd       DIR  252,1     4096      2 \/\napache2 21922     root  rtd       DIR  252,1     4096      2 \/\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">3. Opened files by a specific user<\/h2>\n\n\n\n<p>To list the files opened by a specific user, execute the lsof command with the <strong>-u<\/strong> option and user name.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# lsof -u www-data\nCOMMAND   PID     USER   FD      TYPE DEVICE SIZE\/OFF   NODE NAME\napache2 43491 www-data  cwd       DIR  252,1     4096      2 \/\napache2 43491 www-data  rtd       DIR  252,1     4096      2 \/\napache2 43491 www-data  txt       REG  252,1   758672   6242 \/usr\/sbin\/apache2<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">4. Opened files associated with a specific process ID<\/h2>\n\n\n\n<p>Execute the lsof command with <strong>-p<\/strong> option and process ID for all open files associated with it.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# lsof -p 21922\nCOMMAND   PID USER   FD   TYPE DEVICE SIZE\/OFF   NODE NAME\napache2 21922 root  cwd    DIR  252,1     4096      2 \/\napache2 21922 root  rtd    DIR  252,1     4096      2 \/\napache2 21922 root  txt    REG  252,1   758672   6242 \/usr\/sbin\/apache2\napache2 21922 root  DEL    REG    0,1            1060 \/dev\/zero\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">5. Opened files based on the connection type<\/h2>\n\n\n\n<p>To check the open files based on the connection type TCP or UDP, execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# lsof -i tcp\nCOMMAND   PID     USER   FD   TYPE DEVICE SIZE\/OFF NODE NAME\nsshd    16879     root    3u  IPv4  67331      0t0  TCP *:7022 (LISTEN)\nsshd    16879     root    4u  IPv6  67333      0t0  TCP *:7022 (LISTEN)\napache2 21922     root    4u  IPv6  98560      0t0  TCP *:http (LISTEN)\napache2 43491 www-data    4u  IPv6  98560      0t0  TCP *:http (LISTEN)\napache2 43492 www-data    4u  IPv6  98560      0t0  TCP *:http (LISTEN)\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">6. Suppresses kernel blocks<\/h2>\n\n\n\n<p>To check the suppressed kernel blocks, execute the lsof command with the <strong>-b<\/strong> option.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# lsof -b\nCOMMAND     PID   TID TASKCMD               USER   FD      TYPE             DEVICE SIZE\/OFF       NODE NAME\nsystemd       1                             root  cwd       DIR              252,1     4096          2 \/\nsystemd       1                             root  rtd       DIR              252,1     4096          2 \/\nsystemd       1                             root  txt       REG              252,1  1849992      13141 \/usr\/lib\/systemd\/systemd\nsystemd       1                             root  mem       REG              252,1   149760        690 \/usr\/lib\/x86_64-linux-gnu\/libgpg-error.so.0.32.1\nsystemd       1                             root  mem       REG              252,1    27072        477 \/usr\/lib\/x86_64-linux-gnu\/libcap-ng.so.0.0.0<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">7. Processes that accessed particular files<\/h2>\n\n\n\n<p>To list the IDS of processes that accessed particular files execute the lsof command with the <strong>-t<\/strong> option.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# lsof -t\n1\n3\n12\n13\n14\n15\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">8. Memory-mapped files<\/h2>\n\n\n\n<p>To see the memory mapped files, execute the lsof command with <strong>-d mem<\/strong> option.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# lsof -d mem\nCOMMAND     PID             USER  FD   TYPE DEVICE SIZE\/OFF    NODE NAME\nsystemd       1             root mem    REG  252,1   149760     690 \/usr\/lib\/x86_64-linux-gnu\/libgpg-error.so.0.32.1\ndbus-daem   456       messagebus mem    REG  252,1   309600     591 \/usr\/lib\/x86_64-linux-gnu\/libnss_systemd.so.2\nqemu-ga     524             root mem    REG  252,1    27002    8333 \/usr\/lib\/x86_64-linux-gnu\/gconv\/gconv-modules.cach\nphp-fpm8. 21595     php_fpm_user mem    REG  252,1   284936 1038523 \/usr\/lib\/php\/20210902\/phar.so\nphp-fpm8. 21595     php_fpm_user mem    REG  252,1    35080 1038668 \/usr\/lib\/php\/20210902\/pdo_mysql.so\nphp-fpm8. 21595     php_fpm_user mem    REG  252,1   162056 1038666 \/usr\/lib\/php\/20210902\/mysqli.so\nphp-fpm8. 21595     php_fpm_user mem    REG  252,1   597344   28551 \/usr\/lib\/x86_64-linux-gnu\/libonig.so.5.2.0<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">9. Parent process IDS<\/h2>\n\n\n\n<p>To list the parent process IDs, execute the lsof command with the <strong>-R<\/strong> argument.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# lsof -R\nCOMMAND     PID   TID TASKCMD    PPID             USER   FD      TYPE             DEVICE SIZE\/OFF       NODE NAME\nsystemd       1                     0             root  cwd       DIR              252,1     4096          2 \/\nsystemd       1                     0             root  rtd       DIR              252,1     4096          2 \/\nsystemd       1                     0             root  txt       REG              252,1  1849992      13141 \/usr\/lib\/systemd\/syst\nrcu_tasks    10                     2             root  cwd       DIR              252,1     4096          2 \/\nrcu_tasks    10                     2             root  rtd       DIR              252,1     4096          2 \/\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">10. The man command<\/h2>\n\n\n\n<p>If you want to learn more about the lsof you need to execute <strong>man lsof<\/strong> in your terminal. You should receive complete documentation about the lsof command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# man lsof\nLSOF(8)                                                               System Manager&#039;s Manual                                                               LSOF(8)\n\nNAME\n       lsof - list open files\n\nSYNOPSIS\n       lsof [ -?abChlnNOPRtUvVX ] [ -A A ] [ -c c ] [ +c c ] [ +|-d d ] [ +|-D D ] [ +|-e s ] [ +|-E ] [ +|-f [cfgGn] ] [ -F [f] ] [ -g [s] ] [ -i [i] ] [ -k k ] [\n       -K k ] [ +|-L [l] ] [ +|-m m ] [ +|-M ] [ -o [o] ] [ -p s ] [ +|-r [t[m]] ] [ -s [p:s] ] [ -S [t] ] [ -T [t] ] [ -u s ] [ +|-w ] [ -x [fl] ] [ -z [z] ]\n       [ -Z [Z] ] [ -- ] [names]\n\nDESCRIPTION\n       Lsof revision 4.93.2 lists on its standard output file information about files opened by processes for the following UNIX dialects:\n\n            Apple Darwin 9 and Mac OS X 10.[567]\n            FreeBSD 8.[234], 9.0 and 1[012].0 for AMD64-based systems\n            Linux 2.1.72 and above for x86-based systems\n            Solaris 9, 10 and 11\n\n       (See the DISTRIBUTION section of this manual page for information on how to obtain the latest lsof revision.)\n<\/pre>\n\n\n\n<p>That&#8217;s it. You just learned to use the lsof command with 10 most used options and arguments. Of course, if you have any difficulties with this, you can <a href=\"https:\/\/www.linuxcloudvps.com\/\" title=\"\">contact our technical support<\/a>, and they will help you. You just need to sign up for one of our NVMe VPS plans and submit a support ticket. We are available 24\/7.<\/p>\n\n\n\n<p>If you liked this post about ten useful lsof commands in Linux with examples, please share it with your friends on social networks or simply leave a reply below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog post, we are going to show you ten useful lsof commands in Linux with examples. The lsof command is a shortcut to List open files and shows the open files and which processes are using them. The lsof output describes several things, such as the identification number of the process that has &#8230; <a title=\"10 Useful lsof Commands in Linux With Examples\" class=\"read-more\" href=\"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-lsof-commands-in-linux-with-examples\/\" aria-label=\"More on 10 Useful lsof Commands in Linux With Examples\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":1753,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[207,260],"tags":[27,132,259],"class_list":["post-1752","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guide","category-linux","tag-linux","tag-linuxcloudvps","tag-lsof-commands"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>10 Useful lsof Commands in Linux With Examples | LinuxCloudVPS Blog<\/title>\n<meta name=\"description\" content=\"In this blog post, we are going to show you ten useful lsof commands in Linux with examples. The lsof command is a shortcut to List open files and shows\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-lsof-commands-in-linux-with-examples\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"10 Useful lsof Commands in Linux With Examples | LinuxCloudVPS Blog\" \/>\n<meta property=\"og:description\" content=\"In this blog post, we are going to show you ten useful lsof commands in Linux with examples. The lsof command is a shortcut to List open files and shows\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-lsof-commands-in-linux-with-examples\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxCloudVPS Blog\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/LinuxCloudVPS\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-15T17:30:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2022\/10\/10-useful-lsof-commands-in-linux-with-examples.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"742\" \/>\n\t<meta property=\"og:image:height\" content=\"372\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@LinuxCloudVPS\" \/>\n<meta name=\"twitter:site\" content=\"@LinuxCloudVPS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/10-useful-lsof-commands-in-linux-with-examples\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/10-useful-lsof-commands-in-linux-with-examples\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#\\\/schema\\\/person\\\/ed907227ee7d151c617e6d0fe74f531a\"},\"headline\":\"10 Useful lsof Commands in Linux With Examples\",\"datePublished\":\"2022-10-15T17:30:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/10-useful-lsof-commands-in-linux-with-examples\\\/\"},\"wordCount\":484,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/10-useful-lsof-commands-in-linux-with-examples\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/10-useful-lsof-commands-in-linux-with-examples.jpg\",\"keywords\":[\"linux\",\"linuxcloudvps\",\"lsof commands\"],\"articleSection\":[\"Guide\",\"Linux\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/10-useful-lsof-commands-in-linux-with-examples\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/10-useful-lsof-commands-in-linux-with-examples\\\/\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/10-useful-lsof-commands-in-linux-with-examples\\\/\",\"name\":\"10 Useful lsof Commands in Linux With Examples | LinuxCloudVPS Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/10-useful-lsof-commands-in-linux-with-examples\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/10-useful-lsof-commands-in-linux-with-examples\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/10-useful-lsof-commands-in-linux-with-examples.jpg\",\"datePublished\":\"2022-10-15T17:30:00+00:00\",\"description\":\"In this blog post, we are going to show you ten useful lsof commands in Linux with examples. The lsof command is a shortcut to List open files and shows\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/10-useful-lsof-commands-in-linux-with-examples\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/10-useful-lsof-commands-in-linux-with-examples\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/10-useful-lsof-commands-in-linux-with-examples\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/10-useful-lsof-commands-in-linux-with-examples.jpg\",\"contentUrl\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/10-useful-lsof-commands-in-linux-with-examples.jpg\",\"width\":742,\"height\":372,\"caption\":\"10 useful lsof commands in linux with examples\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/10-useful-lsof-commands-in-linux-with-examples\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"10 Useful lsof Commands in Linux With Examples\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/\",\"name\":\"LinuxCloudVPS\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#organization\",\"name\":\"LinuxCloudVPS\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/logo.png\",\"contentUrl\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/logo.png\",\"width\":217,\"height\":25,\"caption\":\"LinuxCloudVPS\"},\"image\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"http:\\\/\\\/www.facebook.com\\\/LinuxCloudVPS\",\"https:\\\/\\\/x.com\\\/LinuxCloudVPS\",\"http:\\\/\\\/www.linkedin.com\\\/company\\\/linuxcloudvps-com\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#\\\/schema\\\/person\\\/ed907227ee7d151c617e6d0fe74f531a\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"http:\\\/\\\/www.linuxcloudvps.com\\\/\"],\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/author\\\/r0s3admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"10 Useful lsof Commands in Linux With Examples | LinuxCloudVPS Blog","description":"In this blog post, we are going to show you ten useful lsof commands in Linux with examples. The lsof command is a shortcut to List open files and shows","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-lsof-commands-in-linux-with-examples\/","og_locale":"en_US","og_type":"article","og_title":"10 Useful lsof Commands in Linux With Examples | LinuxCloudVPS Blog","og_description":"In this blog post, we are going to show you ten useful lsof commands in Linux with examples. The lsof command is a shortcut to List open files and shows","og_url":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-lsof-commands-in-linux-with-examples\/","og_site_name":"LinuxCloudVPS Blog","article_publisher":"http:\/\/www.facebook.com\/LinuxCloudVPS","article_published_time":"2022-10-15T17:30:00+00:00","og_image":[{"width":742,"height":372,"url":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2022\/10\/10-useful-lsof-commands-in-linux-with-examples.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_creator":"@LinuxCloudVPS","twitter_site":"@LinuxCloudVPS","twitter_misc":{"Written by":"admin","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-lsof-commands-in-linux-with-examples\/#article","isPartOf":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-lsof-commands-in-linux-with-examples\/"},"author":{"name":"admin","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/person\/ed907227ee7d151c617e6d0fe74f531a"},"headline":"10 Useful lsof Commands in Linux With Examples","datePublished":"2022-10-15T17:30:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-lsof-commands-in-linux-with-examples\/"},"wordCount":484,"commentCount":2,"publisher":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-lsof-commands-in-linux-with-examples\/#primaryimage"},"thumbnailUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2022\/10\/10-useful-lsof-commands-in-linux-with-examples.jpg","keywords":["linux","linuxcloudvps","lsof commands"],"articleSection":["Guide","Linux"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.linuxcloudvps.com\/blog\/10-useful-lsof-commands-in-linux-with-examples\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-lsof-commands-in-linux-with-examples\/","url":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-lsof-commands-in-linux-with-examples\/","name":"10 Useful lsof Commands in Linux With Examples | LinuxCloudVPS Blog","isPartOf":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-lsof-commands-in-linux-with-examples\/#primaryimage"},"image":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-lsof-commands-in-linux-with-examples\/#primaryimage"},"thumbnailUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2022\/10\/10-useful-lsof-commands-in-linux-with-examples.jpg","datePublished":"2022-10-15T17:30:00+00:00","description":"In this blog post, we are going to show you ten useful lsof commands in Linux with examples. The lsof command is a shortcut to List open files and shows","breadcrumb":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-lsof-commands-in-linux-with-examples\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.linuxcloudvps.com\/blog\/10-useful-lsof-commands-in-linux-with-examples\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-lsof-commands-in-linux-with-examples\/#primaryimage","url":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2022\/10\/10-useful-lsof-commands-in-linux-with-examples.jpg","contentUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2022\/10\/10-useful-lsof-commands-in-linux-with-examples.jpg","width":742,"height":372,"caption":"10 useful lsof commands in linux with examples"},{"@type":"BreadcrumbList","@id":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-lsof-commands-in-linux-with-examples\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.linuxcloudvps.com\/blog\/"},{"@type":"ListItem","position":2,"name":"10 Useful lsof Commands in Linux With Examples"}]},{"@type":"WebSite","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#website","url":"https:\/\/www.linuxcloudvps.com\/blog\/","name":"LinuxCloudVPS","description":"","publisher":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.linuxcloudvps.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#organization","name":"LinuxCloudVPS","url":"https:\/\/www.linuxcloudvps.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2023\/08\/logo.png","contentUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2023\/08\/logo.png","width":217,"height":25,"caption":"LinuxCloudVPS"},"image":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["http:\/\/www.facebook.com\/LinuxCloudVPS","https:\/\/x.com\/LinuxCloudVPS","http:\/\/www.linkedin.com\/company\/linuxcloudvps-com"]},{"@type":"Person","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/person\/ed907227ee7d151c617e6d0fe74f531a","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","caption":"admin"},"sameAs":["http:\/\/www.linuxcloudvps.com\/"],"url":"https:\/\/www.linuxcloudvps.com\/blog\/author\/r0s3admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts\/1752","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/comments?post=1752"}],"version-history":[{"count":1,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts\/1752\/revisions"}],"predecessor-version":[{"id":1754,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts\/1752\/revisions\/1754"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/media\/1753"}],"wp:attachment":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/media?parent=1752"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/categories?post=1752"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/tags?post=1752"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}