1

Behavior of `du` command with `-L` flag

view story
linux-howto

http://unix.stackexchange.com – I've noticed a strange behavior with du command when it's used with -L command line option. I'm using Slackware 14 and Coreutils 8.19. To reproduce the strange behavior, create two folders: mkdir foo mkdir bar Create a file inside one of the folder: perl -e 'print "A"x10000' > foo/text And a symlink in the other folder: ln -s ../foo/text bar/text Now, if you type: du -h -L bar You'll get: 16k bar Since the symlink was dereferenced. But if you type: du -h -L * You'll get: 16K foo 4.0K bar And the symlink will not be dereferenced. Am I missing something? (HowTos)