
rwxr-xr-x 1 root root 222 Dec 18 04:59 program2.py rwxr-xr-x 1 root root 496 Dec 21 07:13 program.py rwxr-xr-x 1 root root 15K Dec 18 04:55 howtodeleteavirus.txt 1 root root 1.4K Oct 12 06:28 configfile.cfg ls -lh -group-directories-first Example output:ĭrwxr-xr-x 5 root root 4.0K Nov 30 02:29 folder1ĭrwxr-xr-x 18 1000 1000 4.0K Dec 18 03:46 folder2 However, you can add -group-directories-first to show folders listed first (like the default on Windows). Unfortunately, it also lists folders in alphabetical order along with the rest of the files, so you might not be able to tell straight away if something is a file or a folder. If you want to list all files in a directory, along with their sizes, you can use this command: ls -lh There are several ways to get the required information. List only folders and show their total size in current directory: du -h -max-depth=1 Solution List all files (with size), and folders in current directory: ls -lh

Find out disk size of files and folders in Linux.
