Menu
  • HOME
  • TAGS

Using “du” for Total File Size of Certain File Types

shell,unix,du

Pass a list of files to the du command. For example: du -s /tmp/dir1/*.txt A possible solution to getting only the total size is to get the last line of du's output, as in: du -c /tmp/dir1/*.txt | tail -1 ...

How to list the files and folders in a directory with its total size in Linux?

linux,ls,du,df

You can use "du" command to achieve that. Go to the right directory and type du -sh * It will list all files and directories in the current directory like 123G data-1 115G data-2 12K test.txt 14K readme.txt ...

How can I make the “du” command run without outputting all the directories, like quiet mode?

linux,shell,command,disk,du

Use the option -s (summarize): du -sh folder (-h is used to make the output human readable, meaning converting the number of bytes into KB,MB,GB .. )...

How to get the size of folder with fo o.bar name with bash?

bash,namespaces,find,subdirectory,du

You can use -s flag of du command: find /my/folder -maxdepth 1 -name '*.bar' -type d -exec du -sh '{}' \; As per man du: -s, --summarize display only a total for each argument ...

Size() vs ls -la vs du -h which one is correct size?

linux,linux-kernel,ls,image-size,du

They are all correct, they just show different sizes. ls shows size of the file (when you open and read it, that's how many bytes you will get) du shows actual disk usage which can be smaller than the file size due to holes size shows the size of the...

df and du are reporting different amounts of filesystem used

linux,centos,du,df

Run du as root. Files that are not accessible by your user account will not be included in the total sum, so you must run as root to see the sum of all files on the disk.

Why is du command showing double size when h flag is sent?

shell,unix,du

The size on OSX (which I assume you have from the computer name) is calculated on 512-byte blocks because the BSD version of du is used (other versions, like the Cygwin's one I am using now on Windows, behave differently). So for every 1K you get two blocks, apparently doubling...