Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is making this du command error with invalid options?

To get a breakdown of disk usage, always use

du -m -h -s * -c | sort -h

It returns a list like this:

4.0K    merge.sh
8.0K    mergeforums_01.sh
5.2M    _vt
82M     sbc
166M    ip2location.sql
184M    IP2LOCATION-LITE-DB5.CSV
1.6G    _yo.zip
20G     sle
22G     total

But in this one branch of directories, I get this:

du: invalid option -- 'e'
du: invalid option -- 'd'
du: invalid option -- 'i'
du: invalid option -- 't'
du: invalid option -- '4'
du: invalid option -- '.'
du: invalid option -- 'p'
du: invalid option -- 'p'

It looks like it is telling me to edit 4.pp

What is going on?

like image 583
DanAllen Avatar asked Oct 04 '14 12:10

DanAllen


1 Answers

It seems like there's a file whose name starts with a dash -.

Use -- so that filenames expanded are not interpreted as options:

du -m -h -s -c -- * | sort -h
like image 122
falsetru Avatar answered Nov 09 '22 11:11

falsetru