Leonard Evens wrote:
> The command
>
> du -s *
>
> yields the response
>
> du: invalid option -- N
> Try `du --help' for more information.
Thank you for the report but this is almost certainly a data dependent
problem due to the files that happen to be in that directory. The '*'
is a file glob. The * is expanded to the list of files in the current
directory. If one of those files starts with -N then the command will
not be able to differentiate it from an option.
> It works as expected under Scientific Linux SL release 4.5 (Beryllium)
> with du in coreutils-5.2.1-31.6
Probably in a different directory with a different set of files.
In order to make this more reliable and do what you want all of the
time in spite of files starting with a '-' you should specifically say
that you are through with options with '--' or prefix all of the files
with a path such as "./" or both!
du -s -- *
du -s ./*
du -s -- ./*
When you go to remove or mv any file that starts with a '-' you will
have the same issues. See the FAQ for how to deal with them.
http://www.gnu.org/software/coreutils/faq/
Bob