

Ubuntu find file sizes how to#
Now you have learned how to use the du command to check the directory size and file size on your Ubuntu or Debian systems. mp3' | grep totalĮxecute the following command to know more options for the du command. The following command will display the size of the current directory including its sub-directories, but it will exclude the size of all. You can also exclude a certain type of files. To display only the grand total of the given directory including all the sub-directories, use grep command with du command like below. To display the grand total of directories, simply add the -c flag with du -sh command. The output will display the size of this file du -h option will print file size in human readable format (e.g. Similarly, to display the total disk space used by multiple directories, you can use this command. Open the terminal application Change into the directory where the file is located with cd command Type du -h file name Press Enter to run the command. To check the total disk space used by a particular directory, use the -s flag. You can also display the size of multiple directories at once as shown below. du -ah html/ OutputĤ.0K html/partials/single/post-navigation.tplĤ.0K html/partials/single/post-title-meta.tplĤ.0K html/partials/single/layout-magazine.tplĤ.0K html/partials/single/related-posts.tpl To display the disk usage of all items including files and directories, you can use -a flag. The du command only displays the disk usage of directories. You can increase the directory depth level by increasing the value of –max-depth parameter. The largest sub-directories will be displayed on the top. du -k html/ du -m html/įor calculating which sub-directories consume how much disk size, you can use this command: du -h -max-depth=1 | sort -hr To do so, use -k for kilobytes, -m> for megabytes.

You can also display the disk usage size only in KB, or MB, or GB. The du command also displays the files and directory sizes in a recursive manner. So, you use the below command to display in more readable format. OutputĪs you can see in the above output, the size of the directories are displayed in a non-readable format. Is there an Ubuntu 14. Using the -h flag shows the total size of files and directories and the individual size of each file and directory in a human-readable format. To display a specific directory’s size, for example html, run: du html/ The syntax of du command is given below: du [directory}
