Re: command to list all the files and with the path also

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Scott R. Godin wrote:
>> Also, if you're going to do a recursive list using "find", "xargs",
>> and "ls" you're much better off using
>>    find | xargs ls -ld
> 
> perhaps better would be 
>     find -exec ls -ld {} \;

Define better.  :)

Here's the time to run both commands on a new users home directory on
my system (Core Duo T2300, 1GB RAM).

find ~ | xargs ls -ld:

    real    0m0.019s
    user    0m0.008s
    sys     0m0.008s

find ~ -exec ls -ld {}:

    real    0m1.007s
    user    0m0.072s
    sys     0m0.212s

That's on a directory with only 121 entries found by find.  Ouch.

And, the find -exec command's output wasn't aligned consistently like
it is when run from xargs (since with -exec you're executing an ls for
each file or dir, AFAIK).

- -- 
Todd        OpenPGP -> KeyID: 0xD654075A | URL: www.pobox.com/~tmz/pgp
======================================================================
The urge to save humanity is almost always a false front for the urge
to rule.
    -- H. L. Mencken

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (GNU/Linux)
Comment: When crypto is outlawed bayl bhgynjf jvyy unir cevinpl.

iG0EARECAC0FAkSr6N8mGGh0dHA6Ly93d3cucG9ib3guY29tL350bXovcGdwL3Rt
ei5hc2MACgkQuv+09NZUB1pSkQCgnpZBxwPvvuRwoCOHNpxNM+mjmO4AoI1ju3XK
cCntA40UO6AlwXogu/4R
=HsL8
-----END PGP SIGNATURE-----


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux