[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Command line tool to report free/used per partition



On Sat 11 Apr 2020 at 11:53:33 (-0500), Richard Owlett wrote:
> On 04/11/2020 10:51 AM, David Wright wrote:
> > On Sat 11 Apr 2020 at 10:21:16 (-0500), Richard Owlett wrote:
> > > I've a laptop dedicated to comparing space used by different install
> > > options.
> > > 
> > > I need a command line tool report on spaced actually used on each
> > > partition. Gparted reports that by default, but I need a command line
> > > tool.
> > 
> > df for disk space free, du for disk usage. For the latter, you
> > probably want -b, -s and -x and root.
> 
> For my current needs, du is too fine grained.

If fine-grained means precision, use eg -BMB for MB.
If fine-grained means detailed, use -d 0.

# du -b -xd 1 /
49152	/tmp
4096	/srv
4096	/mnt
16384	/lost+found
446484870	/var
8523624668	/usr
116154651	/boot
8198	/media
20937	/home
4096	/opt
541017	/root
10712618	/etc
9097629043	/
# du -BMB -xd 1 /
1MB	/tmp
1MB	/srv
1MB	/mnt
1MB	/lost+found
474MB	/var
9123MB	/usr
117MB	/boot
1MB	/media
1MB	/home
1MB	/opt
1MB	/root
25MB	/etc
9739MB	/
# 

# du -b -xd 0 /
9097629043	/
# du -BMB -xd 0 /
9739MB	/
# 

> My current vision includes cataloging the number of items returned by
> "apt-mark showmanual" and space occupied by the installed system.
> 
> I have not selected all the metrics I wish to compare.

Cheers,
David.


Reply to: