Re: du Weirdness - how is this possible

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

 



On 03/13/2018 01:44 PM, Stephen Morris wrote:
> On 14/3/18 7:19 am, Stephen Morris wrote:
>> On 13/3/18 9:05 am, Ed Greshko wrote:
>>> On 03/13/18 05:47, Ed Greshko wrote:
>>>> On 03/13/18 05:20, Stephen Morris wrote:
>>>>> 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.
>>>> It *does* do exactly what the man page says.  You just have to
>>>> understand the
>>>> "context" in which it is saying it.
>>>>
>>>> Let me complete my thought.  Even take the "ls" command as an example.
>>>>
>>>> [egreshko@meimei test-dir]$ ls
>>>> test  test1  test2
>>>>
>>>> [egreshko@meimei test-dir]$ ls -a
>>>> .  ..  test  test1  test2  .test3  .test4  .test5
>>>>
>>>> [egreshko@meimei test-dir]$ ls *
>>>> test  test1  test2
>>>>
>>>> [egreshko@meimei test-dir]$ shopt -s dotglob
>>>>
>>>> [egreshko@meimei test-dir]$ ls *
>>>> test  test1  test2  .test3  .test4  .test5
>>>>
>>> Oh, when it comes to ls, I've been gently reminded about -A
>>>
>>> [egreshko@meimei test-dir]$ ls -A
>>> test  test1  test2  .test3  .test4  .test5
>>
>> Thanks Ed, I knew about the differences between the -a and -A on ls,
>> and having had a look at the --help for ls and du again, I can see the
>> subtle difference between the -a parameters on both commands. It just
>> seems counter intuitive to me to have to issue another command (even
>> if one knows of its existence) to get a command to function "properly".
> 
> I'm now completely confused. The command du -abh /home/steve/workspace
> is now displaying the information directories beginning with a '.' and
> at least some files beginning with a '.' without having issued the shopt
> command.

Because you didn't include a shell glob. You told du specifically: "show
me the disk usage of /home/steve/workspace". du then walks down THAT
directory tree and du does NOT ignore files starting with a dot.

The difference is: before you used "*" which made the shell expand the
glob (glob meaning "*") and pass a list of files to du to check, but the
important bit is that the _shell_ created the list of files and, by
default, the shell does NOT list files starting with a dot.

Does that clarify it a bit?
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer, AllDigital    ricks@xxxxxxxxxxxxxx -
- AIM/Skype: therps2        ICQ: 22643734            Yahoo: origrps2 -
-                                                                    -
-  Memory is the second thing to go, but I can't remember the first! -
----------------------------------------------------------------------
_______________________________________________
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