find a file

Karl Auer kauer at
Mon Aug 6 12:49:02 UTC 2007

On Mon, 2007-08-06 at 13:26 +0100, norman wrote:
> Thank you. I assume then, that if I am in my home directory, the search
> would include the desktop as a sub-directory. However, if the file I
> want is any other directory such as var or usr then I would need to
> search each of these separately. Is that correct?

You can put the starting directory to search in the command. This will
search in and below /var:

   find /var -name "*.lck" -print

And you can list multiple directories, rather than doing multiple
separate finds. This looks in /var, /usr and the current directory:

   find /var /usr . -name "*.lck" -print

"man find" is your friend; find is a very powerful command.

Regards, K.

Karl Auer (kauer at                   +61-2-64957160 (h)                  +61-428-957160 (mob)

More information about the ubuntu-users mailing list