Re: du Weirdness - how is this possible

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

 



On 13/3/18 8:10 am, Ed Greshko wrote:
On 03/13/18 04:26, Stephen Morris wrote:
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 '.'?:

Of course not.

Compare the -a opt of ls with that of du in their man pages.

ls

        -a, --all
               do not ignore entries starting with

du

        -a, --all
               write counts for all files, not just directories

With du it is saying "all files found based on the pattern specified in [FILES]"
And like all shell commands [FILES} follows the rules of "globbing".  Gordon has
already told you a method you can use to have du consider "." files.

This is by turning on the shell option "dotglob".

Run the "shopt" command by itself and notice the setting for "dotglob".  Then set it
with -s to see how this affects commands when you use "*".  And -u will unset options.

You would probably benefit from doing a bit of searching and finding pages such as

https://www.gnu.org/software/bash/manual/html_node/Filename-Expansion.html
https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html#The-Shopt-Builtin

and more generally

https://www.gnu.org/software/bash/manual/html_node/

Thanks Ed, I'll check the doco out, I was just expecting the command to do exactly what the help info said, output the information for all files, not just a subset.


regards,

Steve



_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
_______________________________________________
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