du: option requires an argument — ‘X’

  • A+
Categories:Linux

Several days ago I encountered this little issue and I found it was very interesting. :)

I got a capacity issue and when I run 'du -sh *' I got error message similar with below:

I have run such commands many many times so I make sure it should be workable, but I still run 'du --help' to read the help manual. Of course I could not find my answer.

While the 'ls *' worked well and the command 'du' was the right one I wanted to use.

When I first got this issue, I got confused and had to ignore it to deal with other urgent issue, while this time I decided to find the reason.

I found it soon!

The root cause was simple and I believe you could find it easily from the above command output, right? :)

Comment

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: