du
command is used to find the file size in Linux. Here i will explain different scenarios where you could use these commands to get size information of files.
To get the size of files and directories recursively, use the following command.
du -a
To get the size in human readable form,
du -ah
To get sizes in directory level, use just du
command.
To calculate the total size of files,
du -ahc
To display only total size
du -sh