[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Did I found a bug in "ls"?
From: |
James Youngman |
Subject: |
Re: Did I found a bug in "ls"? |
Date: |
Sun, 8 Mar 2009 18:21:16 +0000 |
On Sun, Mar 8, 2009 at 3:15 PM, Major Péter <address@hidden> wrote:
> Hi!
>
> I would like to list some folders with they block-sizes, but only specific
> folders am I interested.
> So I would like to use find to list the correct folders for me:
> ls `find . -type d -user foo -name "*"`
-name "*" is redundant I think.
> this is not working because ls can't find folders with spaces in there name,
> so I am using a pipe and sed, to make it comfortable:
This is a very dangerous way to try to solve this problem. See the
findutils Texinfo manual, in particular the section "Safe File Name
Handling".
> ls `find . -user major -type d -name "*" | sed 's,\ ,\\\ ,g'`
> If I'm using echo instead ls, the output is:
> ./foo\ bar
> So I tried to use:
> ls ./foo\ bar
> And it worked!
> The easiest way to check this is using this command in a folder where are
> folders with spaces in they names:
> ls `ls -a | sed 's,\ ,\\\ ,g'`
> Is there may an other way to find out the folders block-size belonging to a
> specific user?
Do you mean the total size in blocks of the contents of each directory
owned by a user? Or the size in blocks occupied by each directory
(i.e. list of files) itself? I'm not sure I clearly understand what
you wanted to do, so it is hard for me to be sure this is the correct
answer, but this is a reasonable guess I think:
$ find glpk -depth -type d -user youngman -print0 | du -s --files0-from=-
1936 glpk/glpk-4.8/doc
12 glpk/glpk-4.8/examples/.deps
1756 glpk/glpk-4.8/examples
356 glpk/glpk-4.8/include
176 glpk/glpk-4.8/src/.deps
3528 glpk/glpk-4.8/src
8 glpk/glpk-4.8/sysdep/gnu
12 glpk/glpk-4.8/sysdep/w32
24 glpk/glpk-4.8/sysdep
7880 glpk/glpk-4.8
960 glpk/tarfile
8844 glpk
> Thanks for your help.
>
> Regards,
> Peter Major
>
>
> _______________________________________________
> Bug-coreutils mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/bug-coreutils
>
Re: Did I found a bug in "ls"?,
James Youngman <=