Check folder (directory) wise disk space usages in Linux Ubuntu

Whenever your server disk space running low then you need to first find all unusual items to delete. To delete items you need to find where max disk space is used.

Here we are explaining to check disk space usages by du command.

du -h

Here -h means space to display in a human-readable format.

Check space by drilling down to the folder.

du -ha --time /var/www --max-depth=1

Output:

45G 2021-12-10 20:45 /var/www/devstudio
20K 2019-08-28 20:48 /var/www/html
658M 2021-12-10 17:47 /var/www/internal
187M 2020-08-19 22:47 /var/www/backup
206M 2020-11-19 11:53 /var/www/old
47G 2021-12-10 20:45 /var/www

Now let check inside /var/www/devstudio

du -ha --time /var/www/devstudio --max-depth=1

Output:

116K   2020-11-18 08:33   /var/www/devstudio/composer.lock
44G    2021-12-10 20:56   /var/www/devstudio/public
4.0K   2020-08-29 11:48    /var/www/devstudio/installetion.txt
16K   2021-10-15 16:08    /var/www/devstudio/.DS_Store
120K 2021-01-29 09:55    /var/www/devstudio/4.pdf
4.0K  2020-10-01 23:15   /var/www/devstudio/next_id.txt
12K  2020-08-29 11:48    /var/www/devstudio/Book2.xlsx
248K 2020-08-29 11:48   /var/www/devstudio/in.html
299M 2021-12-10 17:47  /var/www/devstudio/.git
4.0K  2021-03-09 09:53   /var/www/devstudio/devstudio.json
16K   2020-08-29 11:48   /var/www/devstudio/temp.xlsx
18M  2021-12-10 17:47   /var/www/devstudio/application
2.4M 2021-04-19 02:22   /var/www/devstudio/core
885M 2021-12-10 20:55  /var/www/avsar/logs

 



Keywords: