Clean up disk space — linux

It turns out that my disk space has grown into an issue and I need to clean them up. Here I am documenting the process for this.

Linux command to check disk space

df command - Shows the amount of disk space used and available on Linux file systems.
du command - Display the amount of disk space used by the specified files and for each subdirectory.
btrfs fi df /device/ - Show disk space usage information for a btrfs based mount point/file system.

Check how much have I used? The du command does not work accordingly, see the following:

du -h ~ : it lists everything !!
du -sh ~ : it takes forever!!

It is okay to check a specific directory

du -sh  project2018/NTP_exome_project/
27T     project2018/NTP_exome_project/

Here is a magic command

find /ddn/gs1/home/li11/project2017/exomeSeq/withDBsnp/ -user li11 -type f -printf "%s\n" | awk '{t+=$1} END {print t}' 

Leave a Reply

Your email address will not be published. Required fields are marked *

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