Skip to main content

All Questions

Tagged with
19 votes
2 answers
5k views

Why is a directory copied with the cp command smaller than the original?

I am tying to copy one directory with a large number of files to another destination. I did: cp -r src_dir another_destination/ Then I wanted to confirm that the size of the destination directory is ...
Hirurg103's user avatar
  • 313
0 votes
1 answer
83 views

Unexpected behavior with -h flag passed to du

As long as I've been living in *nix world I've lived under the assumption that when a command accepted a -h flag the only thing I was changing was effectively formatting of a print statement. I don't ...
Slater Victoroff's user avatar
2 votes
2 answers
941 views

How to show uncompressed total physical size in bytes of an HFS-compressed file or directory?

Case in point: Apple's TextEdit at /Applications/TextEdit.app If you calculate the physical size with echo "$(/usr/bin/du -k -d 0 /Applications/TextEdit.app | /usr/bin/awk '{print $1}') * 1024" | /...
JayB's user avatar
  • 211
-3 votes
1 answer
1k views

Does `du /` list every single file on a system? [closed]

Does du / list every single file? || Is there a better way?
voices's user avatar
  • 2,751
0 votes
1 answer
2k views

I know base 2 and base 10 , MB and MiB, but i'm not understanding the byte counts shown for a directory, by du and by windows explorer

The du command shows 43G in use. I'm not sure whether that's base 2 in the sense of 2^30 or if it's base 10, in the sense of 10^9. But anyhow - Running this du command from cygwin, to see the size ...
barlop's user avatar
  • 24.3k
2 votes
1 answer
128 views

du is giving me inconsistent results depending on argument order

I'm running Darwin (Mac OS X 10.11.2 - the current version of El Capitan) on my Mac Book Pro, but this is about a standard command line utility, du. I am getting inconsistent results from du: 21:19 %...
D Mac's user avatar
  • 131
5 votes
1 answer
8k views

Faster du/stat alternative for directories

I have several very big directories and i want to know their estimated size. I use for this purpose mostly du, but it takes for each folder about 3 minutes, so i'm asking if there is an alternative to ...
rwx's user avatar
  • 229
0 votes
2 answers
554 views

du -sb giving different results for 2 directories with same contents?

I have a directory A with 1000 sub-directories (000-999) each containing 3500 .jpg files. I wrote a PHP script that copied each of those files to another directory B in the exact same structure, ...
datasn.io's user avatar
  • 545
1 vote
0 answers
176 views

du on Mac OS 10.9 gives two different answers for the same directory

If I run du on my iMovie Library.imovielibrary I can get two different results depending on how I run du. However, I believe both of these should result in the same value. Behold: davids-imac:Movies ...
devguydavid's user avatar
0 votes
2 answers
738 views

How do I sort command-line output?

I'm trying to use du to sort the output by filesize, but it doesn't looks like there's an option for that. Can I pipe it into another command to handle the sorting?
nipponese's user avatar
  • 1,154
5 votes
1 answer
2k views

Why does du -sl show different sizes for the source and result of a cp -rl?

I have used cp -rl to copy a folder. When measuring the size of the source and of the result of the copy du -sl returns slightly different sizes, even though diff confirms that their content are ...
Laurent Giroud's user avatar