Re: du Weirdness - how is this possible

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

 



On Tue, 2018-03-13 at 07:26 +1100, Stephen Morris wrote:
> > 'du' with no parameters recursively lists all the subdirectories and
> > their sizes, along with the grand total. When applied to my home
> > directory, I get over 30,000 lines of output. That's almost never what
> > I want. My usual call is 'du -hs'.
> > 
> > poc
> 
> Thanks Patrick, taking this a step further, it seems to me that the only 
> parameter for du that, to me, provides the correct file size is -b as 
> shown below.

I think you have a misconception here. 'du' does not give file sizes,
it gives disk usage. A 1-byte file takes up at least 1 disk block, so
that's the size 'du' will give. I seem to remember that it also counts
indirect blocks and other housekeeping that corresponds to the file
without being included in the file's content, but I could be mistaken
(though I'm fairly sure early versions did do that).

> I am listing my Desktop directory via ll, du -hs and du 
> -bhs. Just further to this is it a bug with du that the -a parameter 
> which is supposed to list all files not just directories, does not list 
> files prefixed with a '.'?:

It does list files beginning with '.'. The reason you aren't seeing
these files is because you're implicitly excluding them when you write
'.../*'. The Shell meta-character '*' doesn't match the initial '.'.

poc
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux