LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   du -sh * Command not working (https://www.linuxquestions.org/questions/linux-newbie-8/du-sh-%2A-command-not-working-588628/)

young_rhkid 10-01-2007 09:56 AM

du -sh * Command not working
 
I commonly use the following command 'du -sh *' to get a line item list of all items in a user's account. It has always worked but now I try the same command and the command line gives me:

[root@xxxx useraccount]# du -sh *
du: invalid option -- i
Try `du --help' for more information.

The server in question is using > 'Red Hat Linux release 7.3'

Any idea why I am getting this or how to reset this command?

colucix 10-01-2007 10:49 AM

Quote:

Originally Posted by young_rhkid (Post 2909377)
[root@xxxx useraccount]# du -sh *
du: invalid option -- i
Try `du --help' for more information.

Since you did not pass the option i to the du command, it looks like you have a file called "-i" in the working directory. If this is the case you can try
Code:

du -sh -- *
The -- sign will end the list of options, that is all the arguments after -- are not interpreted as options! This is true for many *nix commands.

pwc101 10-01-2007 10:57 AM

Also, check to see if the command hasn't become aliased to something:
Code:

which du
or
Code:

alias|grep du

young_rhkid 10-01-2007 11:51 AM

Thanks guys! The '--i' option did the trick!


All times are GMT -5. The time now is 09:16 AM.