Is there a command to list a directory total size and then each sub-folder and files inside it .
I also want to sort them by increasing order so that I can see which folder is greater in size.
Is there a command to list a directory total size and then each sub-folder and files inside it .
I also want to sort them by increasing order so that I can see which folder is greater in size.
will get you a human-readable ascending list of the sizes of files and subdirectories in your current directory,
will summarize the current directory size.
My answer is like below :
i used du command for that purpose .
As the picture below i want to see the size of a folder name test and recursively the sub folders and each file in kb :
You can do
ls -sh
to list the file size of the files and folder in the current directoryls -shR *
will list the size and name of files recursively