productionsetr.blogg.se

Find file size linux terminal
Find file size linux terminal







You will find me using the tree command in various guides to show the file system in a hierarchy but it can also be used to get directory size.īy using -du with the tree command, it will get you the total size of a directory including the size of every file and sub-directory present inside. Use the tree command to check directory size in Ubuntu Now, you can have a better idea of how it was sized around 16 gigs!īut the du command has a lot more to offer and if you want to utilize it to its max potential, I'd recommend checking out our detailed guide: du path_to_file_or_directoryįor example, I will be getting details of Directory and use -h option to get output in human-readable form: du -h Directoryīut how could a directory containing one sub-directory worth 1.6 Gb can sum around 16 gigs? Because by default, it only shows details of sub-directories.Īnd by using -a option, you can include files, making it a more sensible output: du -ah Directory

find file size linux terminal

The du (disk usage) command is a popular solution for checking directory sizes in Linux. Use the du command to check directory size in Ubuntu Let's start with the 'official' command for checking the size of a directory. Like most things in Linux, there are several ways to do it. For now, the bigger question is how do you get the directory size in Ubuntu terminal?

find file size linux terminal find file size linux terminal

I'll explain the logic behind 4k directory size later. However, the directory size is always displayed as 4k. The ls command shows the file size in human-readable format with ls -lh.









Find file size linux terminal