Quick Answer: How to Check Directory Size in Linux?
Contents How Do I Find the Size of a Specific Directory in Linux? If You Want to Check the Total Disk Space Used by a Particular Directory, Use the -S Flag. to...
Contents
How do I find the size of a specific directory in Linux?
If you want to check the total disk space used by a particular directory, use the -s flag.
To display the grand total of directories, add -c flag with du -sh command.
To display only the grand total of the given directory including all the sub-directories, use ‘grep’ command with ‘du’ command like below.
How do I find the largest files in a UNIX directory?
Linux find largest file in directory recursively using find
- Open the terminal application.
- Login as root user using the sudo -i command.
- Type du -a /dir/ | sort -n -r. | head -n 20.
- du will estimate file space usage.
- sort will sort out the output of du command.
- head will only show top 20 largest file in /dir/