Re: ls -alR with wd?
On Thu, Jun 10, 2010 at 10:58:58PM +0200, Merciadri Luca wrote:
> Hi,
>
> I find `find' very inefficient when trying to find some files. I prefer
> using `ls -alR | grep stuff' The problem is that the related output does
> not give me the directory where `stuff' is found. How can I add some row
> giving this? Thanks.
Others already mentioned location. I'll just note that 'find' and 'ls
-lR' should have comparable speeds. find's output should be nicer to
parse.
A single 'find' is normally enough to cache the relevant directories.
E.g.:
real 3m48.317s
user 0m1.568s
sys 0m7.948s
tzafrir@sweetmorn:~$ time find /usr >/dev/null
real 0m13.977s
user 0m0.772s
sys 0m1.532s
tzafrir@sweetmorn:~$ time find /usr >/dev/null
real 0m0.956s
user 0m0.332s
sys 0m0.616s
tzafrir@sweetmorn:~$ time find /usr >/dev/null
real 0m0.968s
user 0m0.372s
sys 0m0.576s
Actually the second 'find' took way longer than I expected.
$ free
total used free shared buffers cached
Mem: 2051620 1965084 86536 0 253852 284188
-/+ buffers/cache: 1427044 624576
Swap: 2000968 118404 1882564
--
Tzafrir Cohen | tzafrir@jabber.org | VIM is
http://tzafrir.org.il | | a Mutt's
tzafrir@cohens.org.il | | best
tzafrir@debian.org | | friend
Reply to: