{"id":151,"date":"2017-07-02T11:46:34","date_gmt":"2017-07-02T11:46:34","guid":{"rendered":"http:\/\/orissawebhosting.in\/blog\/?p=151"},"modified":"2019-07-19T04:21:37","modified_gmt":"2019-07-19T04:21:37","slug":"basic-10-commands-to-find-disk-usgae-of-files-and-directories","status":"publish","type":"post","link":"https:\/\/orissawebhosting.in\/blog\/basic-10-commands-to-find-disk-usgae-of-files-and-directories\/","title":{"rendered":"Basic 10 commands to Find disk usage and Memory Usage in linux"},"content":{"rendered":"<p><strong>Commands to find\u00a0disk usage\u00a0of Files and Directories<\/strong><\/p>\n<p><b><code>du<\/code><\/b>\u00a0(abbreviated from\u00a0disk usage) is a linux command used to find the file and directory or folder space usage.<\/p>\n<p><strong>Step 1<\/strong> &#8211; To check the disk usage detail of\u00a0wordpress\/wp-admin directory and its sub folders. Enter the command as :<\/p>\n<pre> #du wordpress\/wp-admin\n<a href=\"http:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-159 size-medium\" src=\"http:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps1-300x170.png\" alt=\"\" width=\"300\" height=\"170\" srcset=\"https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps1-300x170.png 300w, https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps1.png 515w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/pre>\n<p><strong>Step 2<\/strong> &#8211; Now to check the details in &#8220;human Readable format&#8221;. that is you can see the details in KB, MB, GB format.<\/p>\n<pre>#du -h wordpress\/wp-admin\n\n<a href=\"http:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-162 size-medium\" src=\"http:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps2-300x174.png\" alt=\"\" width=\"300\" height=\"174\" srcset=\"https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps2-300x174.png 300w, https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps2.png 498w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/pre>\n<p><strong>Step 3<\/strong> &#8211; \u00a0Insert the <strong>-S<\/strong>\u00a0into\u00a0the du command, it shows\u00a0the total disk space occupied by a directory.<\/p>\n<pre>#du -sh wordpress\/wp-admin \n\n<a href=\"http:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-164 size-medium\" src=\"http:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps3-300x30.png\" alt=\"\" width=\"300\" height=\"30\" srcset=\"https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps3-300x30.png 300w, https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps3.png 356w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/pre>\n<p><strong>Step-4<\/strong>&#8211; \u00a0To show the disk usage based on modification of time, enter the following command as :<\/p>\n<pre>#du --time wordpress\/wp-admin\n\n<a href=\"http:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-168 size-medium\" src=\"http:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps4-300x131.png\" alt=\"\" width=\"300\" height=\"131\" srcset=\"https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps4-300x131.png 300w, https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps4.png 662w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\n<\/pre>\n<p><strong>Step5<\/strong>&#8211; To know the amount of free disk space available in the server, enter the below command as :<\/p>\n<pre>#df -h\u00a0\n\n<a href=\"http:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-175 size-medium\" src=\"http:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps5-300x78.png\" alt=\"\" width=\"300\" height=\"78\" srcset=\"https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps5-300x78.png 300w, https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps5.png 509w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/pre>\n<p><strong>Commands to find\u00a0memory usage\u00a0using linux commands<\/strong><\/p>\n<p><strong>Step1<\/strong>&#8211; Use the following command to see total amount of free and used physical and swap memory in the server.<\/p>\n<p>also use <strong>-m<\/strong>\u00a0command to know the usage details in MB.<\/p>\n<pre>#free \u00a0or \u00a0#free -m\n\n<a href=\"http:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps6-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-182 size-medium\" src=\"http:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps6-1-300x58.png\" alt=\"\" width=\"300\" height=\"58\" srcset=\"https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps6-1-300x58.png 300w, https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps6-1.png 701w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\n<\/pre>\n<p><strong>Step2<\/strong>&#8211; Use the following commands to get processor and memory has been used and other information like running processes too.<\/p>\n<pre>#top \n\n<a href=\"http:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-184 size-medium\" src=\"http:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps7-300x106.png\" alt=\"\" width=\"300\" height=\"106\" srcset=\"https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps7-300x106.png 300w, https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps7-768x272.png 768w, https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps7.png 780w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/pre>\n<p><strong>Step3<\/strong>&#8211; \u00a0Also you can get the same information by using below command.<\/p>\n<pre> #cat \/proc\/meminfo<\/pre>\n<p>Step4 &#8211; vmstat\u00a0reports information about processes, memory, paging, block IO, traps, and cpu activity.<\/p>\n<pre>#vmstat\n\n<a href=\"http:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-195 size-medium\" src=\"http:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps8-300x32.png\" alt=\"\" width=\"300\" height=\"32\" srcset=\"https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps8-300x32.png 300w, https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps8.png 763w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\n<\/pre>\n<p><strong>Step5<\/strong> &#8211;\u00a0To see who is currently logged in and what they are doing on server, enter the below command as :<\/p>\n<pre>#w\n\n<a href=\"http:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps9.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-197 size-medium\" src=\"http:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps9-300x25.png\" alt=\"\" width=\"300\" height=\"25\" srcset=\"https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps9-300x25.png 300w, https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps9-768x63.png 768w, https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/vps9.png 812w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Commands to find\u00a0disk usage\u00a0of Files and Directories du\u00a0(abbreviated from\u00a0disk usage) is a linux command used to find the file and directory or folder space usage. Step 1 &#8211; To check the disk usage detail of\u00a0wordpress\/wp-admin directory and its sub folders. Enter the command as : #du wordpress\/wp-admin Step 2 &#8211; Now to check the details in &#8220;human Readable format&#8221;. that is you can see the details in KB, MB, GB format. #du -h wordpress\/wp-admin Step 3 &#8211; \u00a0Insert the -S\u00a0into\u00a0the du command, it shows\u00a0the total disk space occupied by a&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/151"}],"collection":[{"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/comments?post=151"}],"version-history":[{"count":32,"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/151\/revisions"}],"predecessor-version":[{"id":202,"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/151\/revisions\/202"}],"wp:attachment":[{"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/media?parent=151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/categories?post=151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/tags?post=151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}