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 ...
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 ...
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 ...
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...
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.
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...