[LBo] Find command
James Allen
jfallen at gmail.com
Fri Nov 10 03:04:57 CET 2006
On 11/9/06, jisao <dimark at securenet.net> wrote:
> I have a little bit of problem with the syntax of the find command.
>
> If I am looking for the file menu.lst in the path /boot/grub, how would
> I write the command? Whatever I try, the file is not found, although it
> shows if I ls the /boot/grub directory.
find /boot/grub/ -name menu.lst
>
> Also, can we make the path recursive? Like find Myfile in the /home
> path (Myfile here being in /home/jisao)?
>
> Jisao
find is naturally recursive. If you specify the directroy as / it will
search the entire filesystem.
To limit the depth of directories to search, add the -maxdepth option as in
find /home -maxdepth 2 -name file.txt
One thing that is helpful is to use -iname in place of name. This
makes the argument you are searching for case insensitive.
James
More information about the QnA
mailing list