{"id":4254,"date":"2023-01-23T05:54:05","date_gmt":"2023-01-23T05:54:05","guid":{"rendered":"https:\/\/linuxsimply.com\/?p=4254"},"modified":"2023-08-30T07:17:29","modified_gmt":"2023-08-30T07:17:29","slug":"lsof-command-in-linux","status":"publish","type":"post","link":"https:\/\/linuxsimply.com\/lsof-command-in-linux\/","title":{"rendered":"The \u201clsof\u201d Command in Linux [8 Practical Examples]"},"content":{"rendered":"<p style=\"text-align: justify;\">The <strong>lsof <\/strong>command in <strong>Linux <\/strong>is an easy command. It is used to <strong>display<\/strong> the <strong>list of files<\/strong> that are <strong>opened <\/strong>on a system. Basically using this command you can <strong>view<\/strong> the <strong>information<\/strong> of the <strong>opened files<\/strong> on the system. The \u201c<strong>lsof\u201d <\/strong>stands for \u201c<strong>list open files<\/strong>\u201d. In this article, I will explain to you the ins &amp; outs of the <strong>lsof<\/strong> command in <strong>Linux.<\/strong><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/linuxsimply.com\/lsof-command-in-linux\/#A_Description\" >A. Description<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/linuxsimply.com\/lsof-command-in-linux\/#B_Syntax\" >B. Syntax<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/linuxsimply.com\/lsof-command-in-linux\/#C_Options\" >C. Options<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/linuxsimply.com\/lsof-command-in-linux\/#Practical_Examples_of_the_%E2%80%9Clsof%E2%80%9D_Command_in_Linux\" >Practical Examples of the \u201clsof\u201d Command in Linux<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/linuxsimply.com\/lsof-command-in-linux\/#Example_1_Display_List_of_All_Open_Files_for_All_Processes_Using_the_%E2%80%9Clsof%E2%80%9D_Command_in_Linux\" >Example 1: Display List of All Open Files for All Processes Using the \u201clsof\u201d Command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/linuxsimply.com\/lsof-command-in-linux\/#Example_2_Display_List_of_All_Open_Files_for_Specific_User\" >Example 2: Display List of All Open Files for Specific User<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/linuxsimply.com\/lsof-command-in-linux\/#Example_3_View_List_of_All_Open_Files_for_All_Except_Specific_User\" >Example 3: View List of All Open Files for All Except Specific User<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/linuxsimply.com\/lsof-command-in-linux\/#Example_4_Show_a_List_of_All_Open_Files_for_Specific_Process_ID_Using_the_%E2%80%9Clsof%E2%80%9D_Command_in_Linux\" >Example 4: Show a List of All Open Files for Specific Process ID Using the \u201clsof\u201d Command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/linuxsimply.com\/lsof-command-in-linux\/#Example_5_View_List_of_All_Open_Files_for_All_Except_Specific_Process_ID\" >Example 5: View List of All Open Files for All Except Specific Process ID<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/linuxsimply.com\/lsof-command-in-linux\/#Example_6_Display_a_List_of_All_Files_Opened_by_Network_Connections\" >Example 6: Display a List of All Files Opened by Network Connections<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/linuxsimply.com\/lsof-command-in-linux\/#Example_7_Display_List_of_All_Open_Files_of_Specific_Directory_Using_the_%E2%80%9Clsof%E2%80%9D_Command_in_Linux\" >Example 7: Display List of All Open Files of Specific Directory Using the \u201clsof\u201d Command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/linuxsimply.com\/lsof-command-in-linux\/#Example_8_Show_List_of_All_Files_Opened_by_Parent_Process_ID_Using_the_%E2%80%9Clsof%E2%80%9D_Command_in_Linux\" >Example 8: Show List of All Files Opened by Parent Process ID Using the \u201clsof\u201d Command in Linux<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/linuxsimply.com\/lsof-command-in-linux\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"A_Description\"><\/span>A. Description<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The <strong>lsof<\/strong> command displays the list of opened files in <strong>Linux. <\/strong>It also displays opened files for specific <strong>users<\/strong> or specific <strong>processes<\/strong>. You can also view the list of opened files in a specific <strong>directory<\/strong>. Each <strong>line<\/strong> of the output represents <strong>one open file<\/strong> and the <strong>columns<\/strong> represent the <strong>information<\/strong> about the opened files.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"B_Syntax\"><\/span>B. Syntax<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The <strong>lsof<\/strong> command in <strong>Linux<\/strong> has relatively straightforward syntax. The syntax is as follows:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">lsof [OPTION]<\/code><\/pre>\n<div class=\"su-note\"  style=\"border-color:#cedfe2;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#E8F9FC;border-color:#ffffff;color:#333333;\">\n<p><strong>Note:<\/strong> In the syntax above, <strong>OPTION<\/strong> is enclosed by a square bracket representing that one option can be used at the same time.<\/p>\n<\/div><\/div>\n<h3><span class=\"ez-toc-section\" id=\"C_Options\"><\/span>C. Options<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">A good quantity of <strong>options<\/strong> is available for the <strong>lsof<\/strong> command. I have listed some useful options for the command here. Yet, you can explore the <strong>man<\/strong> <strong>page <\/strong>for the <strong>lsof <\/strong>command to know more about its options.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">man lsof<\/code><\/pre>\n<p><span style=\"color: #800080;\"><strong>Useful Options<\/strong><\/span><\/p>\n<div class=\"su-list\" style=\"margin-left:20px\">\n<ul>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> <strong>-u, <\/strong>Displays the list of opened files for a specific user.<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> <strong>-p, <\/strong>Shows the list of opened files for a specific process.<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> <strong>-i, <\/strong>Shows the list of files opened by network connections.<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> <strong>-R,<\/strong> Displays the list of files opened by parent process id.<\/li>\n<\/ul>\n<\/div>\n<div class=\"su-note\"  style=\"border-color:#cedfe2;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#E8F9FC;border-color:#ffffff;color:#333333;\">\n<p><strong>Note:<\/strong> The options in <strong>Linux <a href=\"https:\/\/linuxsimply.com\/cli-in-linux\/\" target=\"_blank\" rel=\"noopener\">CLI (Command Line Interface)<\/a><\/strong> are <strong>case-sensitive<\/strong>, so be alert while using them.<\/p>\n<\/div><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Practical_Examples_of_the_%E2%80%9Clsof%E2%80%9D_Command_in_Linux\"><\/span>Practical Examples of the \u201clsof\u201d Command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">The <strong>lsof <\/strong>command in <strong>Linux <\/strong>is a simple command which will show the list of open files. I have shown some useful examples of the <strong>lsof <\/strong>command here.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_1_Display_List_of_All_Open_Files_for_All_Processes_Using_the_%E2%80%9Clsof%E2%80%9D_Command_in_Linux\"><\/span>Example 1: Display List of All Open Files for All Processes Using the \u201clsof\u201d Command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To display the <strong>list of all opened files<\/strong> I am using the <strong>lsof<\/strong> command in <strong>Linux<\/strong>. You can also do the same by following the below instructions:<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<\/strong><\/span><\/p>\n<p>\u278a At first open the <strong>Ubuntu Terminal<\/strong>.<\/p>\n<p>\u278b Write the following command in the command prompt:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">lsof<\/code><\/pre>\n<p>\u278c Now, press the <strong>ENTER<\/strong> button.<\/p>\n<p><span style=\"color: #800080;\"><strong>Output &gt;<\/strong><\/span><\/p>\n<p>In the image below, you can see the<strong> list of opened files<\/strong> displayed here.<img decoding=\"async\" class=\"aligncenter size-full wp-image-4262\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-1-c.png\" alt=\"Display List of All Open Files for All Processes Using the \u201clsof\u201d Command in Linux\" width=\"387\" height=\"52\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-1-c.png 387w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-1-c-300x40.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-1-c-1024x138.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-1-c-767x103.png 767w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-1-c-1536x206.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-1-c-2048x275.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-1-c-1116x150.png 1116w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-1-c-100x13.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-1-c-788x105.png 788w\" sizes=\"(max-width: 387px) 100vw, 387px\" \/><\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-4263\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-1.png\" alt=\"Display List of All Open Files for All Processes Using the \u201clsof\u201d Command in Linux\" width=\"825\" height=\"521\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-1.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-1-300x189.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-1-1024x647.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-1-768x485.png 768w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-1-1536x970.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-1-2048x1293.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-1-238x150.png 238w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-1-100x63.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-1-554x350.png 554w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-1-788x497.png 788w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/p>\n<hr \/>\n<p><strong><span style=\"color: #000080; font-size: 18pt;\">Similar Readings<\/span><\/strong><\/p>\n<ul>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/pwd-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cpwd\u201d Command in Linux [4 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/cd-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201ccd\u201d Command in Linux [6 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/ls-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cls\u201d Command in Linux [7+ Practical Examples]<\/a><\/strong><\/li>\n<\/ul>\n<hr \/>\n<h3><span class=\"ez-toc-section\" id=\"Example_2_Display_List_of_All_Open_Files_for_Specific_User\"><\/span>Example 2: Display List of All Open Files for Specific User<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To display the <strong>list of opened files<\/strong> for <strong>specific users<\/strong> you can use the <strong>lsof<\/strong> command in <strong>Linux<\/strong>. Here I want to display the list of all opened files for the user named <strong>sylvie<\/strong>. To display the list of opened files of your desired user, follow the steps below:<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<\/strong><\/span><\/p>\n<p>\u278a First launch the <strong>Ubuntu Terminal<\/strong>.<\/p>\n<p>\u278b Type the following command in the command prompt:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">lsof -u sylvie<\/code><\/pre>\n<p>\u278c Then, press the <strong>ENTER<\/strong> button.<\/p>\n<p><span style=\"color: #800080;\"><strong>Output &gt;<\/strong><\/span><\/p>\n<p>In the following image, you can see the <strong>list of opened files<\/strong> for the user <strong>sylvie<\/strong> are shown here.<img decoding=\"async\" class=\"aligncenter size-full wp-image-4264\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-2-c.png\" alt=\"Display List of All Open Files for Specific User\" width=\"508\" height=\"42\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-2-c.png 508w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-2-c-300x25.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-2-c-1024x85.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-2-c-762x63.png 762w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-2-c-1536x127.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-2-c-2048x169.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-2-c-1814x150.png 1814w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-2-c-100x8.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-2-c-788x65.png 788w\" sizes=\"(max-width: 508px) 100vw, 508px\" \/><\/p>\n<h3><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4265\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-2.png\" alt=\"Display List of All Open Files for Specific User\" width=\"825\" height=\"521\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-2.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-2-300x189.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-2-1024x647.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-2-768x485.png 768w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-2-1536x970.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-2-2048x1293.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-2-238x150.png 238w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-2-100x63.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-2-554x350.png 554w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-2-788x497.png 788w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/h3>\n<h3><span class=\"ez-toc-section\" id=\"Example_3_View_List_of_All_Open_Files_for_All_Except_Specific_User\"><\/span>Example 3: View List of All Open Files for All Except Specific User<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To view the <strong>list of opened files<\/strong> for all <strong>except<\/strong> <strong>specific users<\/strong> I am using the <strong>lsof<\/strong> command in <strong>Linux<\/strong>. Here I want to display the list of all opened files for all users <strong>except<\/strong> the <strong>user sylvie<\/strong>. To do the same you can follow the process below:<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<\/strong><\/span><\/p>\n<p>\u278a Open the <strong>Ubuntu Terminal<\/strong>.<\/p>\n<p>\u278b Copy the following command in the command prompt:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">lsof -u ^sylvie<\/code><\/pre>\n<p>\u278c Finally, strike the <strong>ENTER<\/strong> key.<\/p>\n<p><span style=\"color: #800080;\"><strong>Output &gt;<\/strong><\/span><\/p>\n<p>In the following image, the output displays the <strong>list of opened files<\/strong> for all <strong>except <\/strong>the user <strong>sylvie<\/strong>.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4266\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-3.png\" alt=\"View List of All Open Files for All Except Specific User\" width=\"825\" height=\"521\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-3.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-3-300x189.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-3-1024x647.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-3-768x485.png 768w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-3-1536x970.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-3-2048x1293.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-3-238x150.png 238w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-3-100x63.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-3-554x350.png 554w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-3-788x497.png 788w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_4_Show_a_List_of_All_Open_Files_for_Specific_Process_ID_Using_the_%E2%80%9Clsof%E2%80%9D_Command_in_Linux\"><\/span>Example 4: Show a List of All Open Files for Specific Process ID Using the \u201clsof\u201d Command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To show the <strong>list of opened files<\/strong> for <strong>specific process id<\/strong> I am using the <strong>lsof<\/strong> command in <strong>Linux<\/strong>. Here I want to show the list of all opened files for a <strong>specific process id <\/strong>which is<strong> 26<\/strong>. To do this you can follow the procedure below:<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<\/strong><\/span><\/p>\n<p>\u278a Initially open the <strong>Terminal <\/strong>in<strong> Ubuntu<\/strong>.<\/p>\n<p>\u278b Copy the following command in the command prompt:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">lsof -p 26<\/code><\/pre>\n<p>\u278c After that, hit the <strong>ENTER<\/strong> button.<\/p>\n<p><span style=\"color: #800080;\"><strong>Output &gt;<\/strong><\/span><\/p>\n<p>In the image below, the output displays the<strong> list of opened files<\/strong> for <strong>process id 26<\/strong>.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4267\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-4.png\" alt=\"Show List of All Open Files for Specific Process ID Using the \u201clsof\u201d Command in Linux\" width=\"825\" height=\"210\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-4.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-4-300x76.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-4-1024x261.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-4-766x195.png 766w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-4-1536x391.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-4-2048x521.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-4-589x150.png 589w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-4-100x25.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-4-1375x350.png 1375w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-4-788x200.png 788w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_5_View_List_of_All_Open_Files_for_All_Except_Specific_Process_ID\"><\/span>Example 5: View List of All Open Files for All Except Specific Process ID<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To view the <strong>list of opened files<\/strong> for all <strong>except<\/strong> <strong>specific process id<\/strong> I am using the <strong>lsof<\/strong> command in <strong>Linux<\/strong>. Here I want to show the list of all opened files for all except a specific<strong> process id <\/strong>which is<strong> 26<\/strong>. To do this you can follow the instructions below:<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<\/strong><\/span><\/p>\n<p>\u278a To start, launch the <strong>Terminal <\/strong>in<strong> Ubuntu<\/strong>.<\/p>\n<p>\u278b Copy the following command in the command prompt:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">lsof -p ^26<\/code><\/pre>\n<p>\u278c Finally, strike the <strong>ENTER<\/strong> key.<\/p>\n<p><span style=\"color: #800080;\"><strong>Output &gt;<\/strong><\/span><\/p>\n<p>As you can see in the image below, the <strong>list of opened files<\/strong> for all except <strong>process id 26 <\/strong>are shown here.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4268\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-5-c.png\" alt=\"View List of All Open Files for All Except Specific Process ID\" width=\"458\" height=\"40\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-5-c.png 458w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-5-c-300x26.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-5-c-1024x89.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-5-c-767x67.png 767w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-5-c-1536x134.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-5-c-2048x179.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-5-c-1718x150.png 1718w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-5-c-100x9.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-5-c-788x68.png 788w\" sizes=\"(max-width: 458px) 100vw, 458px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4269\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-5.png\" alt=\"View List of All Open Files for All Except Specific Process ID\" width=\"825\" height=\"521\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-5.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-5-300x189.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-5-1024x647.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-5-768x485.png 768w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-5-1536x970.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-5-2048x1293.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-5-238x150.png 238w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-5-100x63.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-5-554x350.png 554w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-5-788x497.png 788w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/p>\n<hr \/>\n<p><strong><span style=\"color: #000080; font-size: 18pt;\">Similar Readings<\/span><\/strong><\/p>\n<ul>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/mv-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cmv\u201d Command in Linux [8 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/cp-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201ccp\u201d Command in Linux [6 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/rm-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201crm\u201d Command in Linux [7 Practical Examples]<\/a><\/strong><\/li>\n<\/ul>\n<hr \/>\n<h3><span class=\"ez-toc-section\" id=\"Example_6_Display_a_List_of_All_Files_Opened_by_Network_Connections\"><\/span>Example 6: Display a List of All Files Opened by Network Connections<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">I am using the <strong>lsof<\/strong> command to display the <strong>list of files<\/strong> <strong>opened <\/strong>by<strong> network connections<\/strong> in <strong>Linux<\/strong>. Here I want to display the list of all files opened by <strong>tcp protocol<\/strong>. You can do the same by following the steps below:<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<\/strong><\/span><\/p>\n<p>\u278a To initiate open the <strong>Terminal <\/strong>in<strong> Ubuntu<\/strong>.<\/p>\n<p>\u278b Write the following command in the command prompt:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sudo lsof -i tcp<\/code><\/pre>\n<p>\u278c Now, press the <strong>ENTER<\/strong> key.<\/p>\n<p><span style=\"color: #800080;\"><strong>Output &gt;<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\">As you can see in the following image, the <strong>list of <\/strong><strong>all files opened<\/strong> by the <strong>network connections <\/strong>are displayed here.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4270\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-6.png\" alt=\"Display List of All Files Opened by Network Connections\" width=\"825\" height=\"169\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-6.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-6-300x61.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-6-1024x210.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-6-766x157.png 766w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-6-1536x315.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-6-2048x420.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-6-732x150.png 732w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-6-100x20.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-6-1709x350.png 1709w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-6-788x161.png 788w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_7_Display_List_of_All_Open_Files_of_Specific_Directory_Using_the_%E2%80%9Clsof%E2%80%9D_Command_in_Linux\"><\/span>Example 7: Display List of All Open Files of Specific Directory Using the \u201clsof\u201d Command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">I am using the <strong>lsof<\/strong> command to display the <strong>list of<\/strong> <strong>opened files<\/strong> of a <strong>specific directory<\/strong> in <strong>Linux<\/strong>.\u00a0 Here I want to display the list of opened files of the directory named<strong> sylvie<\/strong>. So If you want to do the same follow the steps below:<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<\/strong><\/span><\/p>\n<p>\u278a To start open the <strong>Ubuntu Terminal<\/strong>.<\/p>\n<p>\u278b Type the following command in the command prompt:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">lsof \/home\/sylvie<\/code><\/pre>\n<p>\u278c Then, press the <strong>ENTER<\/strong> key.<\/p>\n<p><span style=\"color: #800080;\"><strong>Output &gt;<\/strong><\/span><\/p>\n<p>As you can see in the image below, the output shows the <strong>list of all opened files<\/strong> of the <strong>directory <\/strong>named <strong>sylvie<\/strong>.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4271\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-7.png\" alt=\"Display List of All Open Files of Specific Directory Using the \u201clsof\u201d Command in Linux\" width=\"1297\" height=\"819\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-7.png 1297w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-7-300x189.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-7-1024x647.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-7-766x484.png 766w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-7-1536x970.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-7-2048x1293.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-7-238x150.png 238w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-7-100x63.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-7-554x350.png 554w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-7-788x497.png 788w\" sizes=\"(max-width: 1297px) 100vw, 1297px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_8_Show_List_of_All_Files_Opened_by_Parent_Process_ID_Using_the_%E2%80%9Clsof%E2%80%9D_Command_in_Linux\"><\/span>Example 8: Show List of All Files Opened by Parent Process ID Using the \u201clsof\u201d Command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To show the list of files opened by the <strong>parent process id<\/strong> I am using the <strong>lsof<\/strong> command in <strong>Linux<\/strong>. So to do this you can follow the instructions below:<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<\/strong><\/span><\/p>\n<p>\u278a Initially launch the<strong> Ubuntu<\/strong> <strong>Terminal<\/strong>.<\/p>\n<p>\u278b Copy the following command in the command prompt:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">lsof -R<\/code><\/pre>\n<p>\u278c Finally, tap the <strong>ENTER<\/strong> button.<\/p>\n<p><span style=\"color: #800080;\"><strong>Output &gt;<\/strong><\/span><\/p>\n<p>In the image below, the output displays the<strong> list of files opened<\/strong> by the <strong>parent<\/strong> <strong>process id<\/strong>.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4272\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-8-c.png\" alt=\"Show List of All Files Opened by Parent Process ID Using the \u201clsof\u201d Command in Linux\" width=\"395\" height=\"38\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-8-c.png 395w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-8-c-300x29.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-8-c-1024x99.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-8-c-759x73.png 759w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-8-c-1536x148.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-8-c-2048x197.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-8-c-1559x150.png 1559w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-8-c-100x10.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-8-c-788x75.png 788w\" sizes=\"(max-width: 395px) 100vw, 395px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4273\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-8.png\" alt=\"Show List of All Files Opened by Parent Process ID Using the \u201clsof\u201d Command in Linux\" width=\"825\" height=\"522\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-8.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-8-300x190.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-8-1024x648.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-8-767x485.png 767w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-8-1536x972.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-8-2048x1296.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-8-237x150.png 237w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-8-100x63.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-8-553x350.png 553w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-8-788x498.png 788w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">As explained in this article, the <strong>lsof<\/strong> command has various uses in <strong>Linux<\/strong>. You\u2019ve also found the <strong>syntax<\/strong>, <strong>some functional options<\/strong>, and the <strong>practical applications<\/strong> of this command. To become a power user in <strong>Linux<\/strong>, have a glance at the command and its practical applications thoroughly.<\/p>\n<hr \/>\n<p><strong><span style=\"color: #000080; font-size: 18pt;\">Similar Readings<\/span><\/strong><\/p>\n<ul>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/touch-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201ctouch\u201d Command in Linux [8 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/mkdir-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cmkdir\u201d Command in Linux [6+ Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/locate-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201clocate\u201d Command in Linux [7 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/find-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cfind\u201d Command in Linux [10+ Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/chmod-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cchmod\u201d Command in Linux [6 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/chown-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The &#8220;chown&#8221; Command in Linux [8 Practical Examples]<\/a><\/strong><\/li>\n<\/ul>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-center kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;center&quot;,&quot;id&quot;:&quot;4254&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;Rate this post&quot;,&quot;legend&quot;:&quot;0\\\/5 - (0 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;The \u201clsof\u201d Command in Linux [8 Practical Examples]&quot;,&quot;width&quot;:&quot;0&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 0px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            <span class=\"kksr-muted\">Rate this post<\/span>\n    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>The lsof command in Linux is an easy command. It is used to display the list of files that are &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"The \u201clsof\u201d Command in Linux [8 Practical Examples]\" class=\"read-more button\" href=\"https:\/\/linuxsimply.com\/lsof-command-in-linux\/#more-4254\" aria-label=\"Read more about The \u201clsof\u201d Command in Linux [8 Practical Examples]\">Read more<\/a><\/p>\n","protected":false},"author":314895,"featured_media":4258,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[55],"class_list":["post-4254","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-commands","tag-file-management-commands","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>The \u201clsof\u201d Command in Linux [8 Practical Examples]<\/title>\n<meta name=\"description\" content=\"The lsof command is used to display the list of opened files in Linux. And the syntax is as follows: lsof [OPTION].\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/linuxsimply.com\/lsof-command-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The \u201clsof\u201d Command in Linux [8 Practical Examples]\" \/>\n<meta property=\"og:description\" content=\"The lsof command is used to display the list of opened files in Linux. And the syntax is as follows: lsof [OPTION].\" \/>\n<meta property=\"og:url\" content=\"https:\/\/linuxsimply.com\/lsof-command-in-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxSimply\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/jannatsylvie\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-23T05:54:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-30T07:17:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-featured-image.png\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Jannatul Ferdousi Sylvie\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jannatul Ferdousi Sylvie\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/lsof-command-in-linux\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/lsof-command-in-linux\\\/\"},\"author\":{\"name\":\"Jannatul Ferdousi Sylvie\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/40ad76e7ddab94d5e04bf736331e600d\"},\"headline\":\"The \u201clsof\u201d Command in Linux [8 Practical Examples]\",\"datePublished\":\"2023-01-23T05:54:05+00:00\",\"dateModified\":\"2023-08-30T07:17:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/lsof-command-in-linux\\\/\"},\"wordCount\":1270,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/lsof-command-in-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/lsof-featured-image.png\",\"keywords\":[\"file management commands\"],\"articleSection\":[\"Linux Commands\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/lsof-command-in-linux\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/lsof-command-in-linux\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/lsof-command-in-linux\\\/\",\"name\":\"The \u201clsof\u201d Command in Linux [8 Practical Examples]\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/lsof-command-in-linux\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/lsof-command-in-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/lsof-featured-image.png\",\"datePublished\":\"2023-01-23T05:54:05+00:00\",\"dateModified\":\"2023-08-30T07:17:29+00:00\",\"description\":\"The lsof command is used to display the list of opened files in Linux. And the syntax is as follows: lsof [OPTION].\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/lsof-command-in-linux\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/lsof-command-in-linux\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/lsof-command-in-linux\\\/#primaryimage\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/lsof-featured-image.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/lsof-featured-image.png\",\"width\":400,\"height\":400,\"caption\":\"lsof command in Linux\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/lsof-command-in-linux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"The \u201clsof\u201d Command in Linux [8 Practical Examples]\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"name\":\"LinuxSimply\",\"description\":\"All About Linux\",\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/linuxsimply.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\",\"name\":\"LinuxSimply\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"width\":355,\"height\":48,\"caption\":\"LinuxSimply\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/40ad76e7ddab94d5e04bf736331e600d\",\"name\":\"Jannatul Ferdousi Sylvie\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Jannatul-Ferdousi-Sylvie-II-96x96.png\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Jannatul-Ferdousi-Sylvie-II-96x96.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Jannatul-Ferdousi-Sylvie-II-96x96.png\",\"caption\":\"Jannatul Ferdousi Sylvie\"},\"description\":\"Hi there! This is Jannatul Ferdousi Sylvie. I am one of the Linux Content Developer Executives at Softeko. I live in Dhaka, Bangladesh. I have completed my BSc. in Software Engineering from American International University-Bangladesh. You can see my projects in the GitHub account. I love traveling, shopping, cooking, and gardening. Read Full Bio\",\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/jannatsylvie\\\/\",\"https:\\\/\\\/www.instagram.com\\\/jannatsylvie\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/jannatsylvie\\\/\",\"https:\\\/\\\/www.pinterest.com\\\/JannatSylvie\\\/\"],\"url\":\"https:\\\/\\\/linuxsimply.com\\\/author\\\/sylvie\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"The \u201clsof\u201d Command in Linux [8 Practical Examples]","description":"The lsof command is used to display the list of opened files in Linux. And the syntax is as follows: lsof [OPTION].","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:\/\/linuxsimply.com\/lsof-command-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"The \u201clsof\u201d Command in Linux [8 Practical Examples]","og_description":"The lsof command is used to display the list of opened files in Linux. And the syntax is as follows: lsof [OPTION].","og_url":"https:\/\/linuxsimply.com\/lsof-command-in-linux\/","og_site_name":"LinuxSimply","article_author":"https:\/\/www.facebook.com\/jannatsylvie\/","article_published_time":"2023-01-23T05:54:05+00:00","article_modified_time":"2023-08-30T07:17:29+00:00","og_image":[{"width":400,"height":400,"url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-featured-image.png","type":"image\/png"}],"author":"Jannatul Ferdousi Sylvie","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jannatul Ferdousi Sylvie","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/linuxsimply.com\/lsof-command-in-linux\/#article","isPartOf":{"@id":"https:\/\/linuxsimply.com\/lsof-command-in-linux\/"},"author":{"name":"Jannatul Ferdousi Sylvie","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/40ad76e7ddab94d5e04bf736331e600d"},"headline":"The \u201clsof\u201d Command in Linux [8 Practical Examples]","datePublished":"2023-01-23T05:54:05+00:00","dateModified":"2023-08-30T07:17:29+00:00","mainEntityOfPage":{"@id":"https:\/\/linuxsimply.com\/lsof-command-in-linux\/"},"wordCount":1270,"commentCount":0,"publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"image":{"@id":"https:\/\/linuxsimply.com\/lsof-command-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-featured-image.png","keywords":["file management commands"],"articleSection":["Linux Commands"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/linuxsimply.com\/lsof-command-in-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/linuxsimply.com\/lsof-command-in-linux\/","url":"https:\/\/linuxsimply.com\/lsof-command-in-linux\/","name":"The \u201clsof\u201d Command in Linux [8 Practical Examples]","isPartOf":{"@id":"https:\/\/linuxsimply.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/linuxsimply.com\/lsof-command-in-linux\/#primaryimage"},"image":{"@id":"https:\/\/linuxsimply.com\/lsof-command-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-featured-image.png","datePublished":"2023-01-23T05:54:05+00:00","dateModified":"2023-08-30T07:17:29+00:00","description":"The lsof command is used to display the list of opened files in Linux. And the syntax is as follows: lsof [OPTION].","breadcrumb":{"@id":"https:\/\/linuxsimply.com\/lsof-command-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/linuxsimply.com\/lsof-command-in-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/lsof-command-in-linux\/#primaryimage","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-featured-image.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/01\/lsof-featured-image.png","width":400,"height":400,"caption":"lsof command in Linux"},{"@type":"BreadcrumbList","@id":"https:\/\/linuxsimply.com\/lsof-command-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/linuxsimply.com\/"},{"@type":"ListItem","position":2,"name":"The \u201clsof\u201d Command in Linux [8 Practical Examples]"}]},{"@type":"WebSite","@id":"https:\/\/linuxsimply.com\/#website","url":"https:\/\/linuxsimply.com\/","name":"LinuxSimply","description":"All About Linux","publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/linuxsimply.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/linuxsimply.com\/#organization","name":"LinuxSimply","url":"https:\/\/linuxsimply.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","width":355,"height":48,"caption":"LinuxSimply"},"image":{"@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/40ad76e7ddab94d5e04bf736331e600d","name":"Jannatul Ferdousi Sylvie","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Jannatul-Ferdousi-Sylvie-II-96x96.png","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Jannatul-Ferdousi-Sylvie-II-96x96.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Jannatul-Ferdousi-Sylvie-II-96x96.png","caption":"Jannatul Ferdousi Sylvie"},"description":"Hi there! This is Jannatul Ferdousi Sylvie. I am one of the Linux Content Developer Executives at Softeko. I live in Dhaka, Bangladesh. I have completed my BSc. in Software Engineering from American International University-Bangladesh. You can see my projects in the GitHub account. I love traveling, shopping, cooking, and gardening. Read Full Bio","sameAs":["https:\/\/www.facebook.com\/jannatsylvie\/","https:\/\/www.instagram.com\/jannatsylvie\/","https:\/\/www.linkedin.com\/in\/jannatsylvie\/","https:\/\/www.pinterest.com\/JannatSylvie\/"],"url":"https:\/\/linuxsimply.com\/author\/sylvie\/"}]}},"_links":{"self":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/4254","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/users\/314895"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/comments?post=4254"}],"version-history":[{"count":0,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/4254\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media\/4258"}],"wp:attachment":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media?parent=4254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/categories?post=4254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/tags?post=4254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}