[lug] Puzzle with find
Hugh Brown
hugh at math.byu.edu
Thu Jul 7 20:51:23 MDT 2005
On Thu, 2005-07-07 at 16:37 -0400, Gordon Golding wrote:
> I want to find any file whose name contains "install"
> I do: find / -name *install*
>
> This works just fine. Except if I am in the root directory:
>
> [root at rl6-182-196-dhcp /]# cd -
> /home
> [root at rl6-182-196-dhcp home]# /usr/bin/find / -name *install*
> /sbin/grub-install
> .... and so on ....
> [root at rl6-182-196-dhcp home]# cd -
> /
> [root at rl6-182-196-dhcp /]# /usr/bin/find / -name *install*
> /sbin/grub-install
> .... and so on ....
> [root at rl6-182-196-dhcp /]# cd -
> /root
> [root at rl6-182-196-dhcp ~]# /usr/bin/find / -name *install*
> /usr/bin/find: paths must precede expression
> Usage: /usr/bin/find [path...] [expression]
I'd bet that you have an install.log file in /root so the shell glob is
doing you in. As noted before quoting the expression should fix it.
As for locate, the command that regenerates the db is usu.
in /etc/cron.daily On Redhat it is /etc/cron.daily/slocate.cron (though
on RH4 you have to edit /etc/updatedb.conf and set DAILY_UPDATE=yes. On
Debian it is /etc/cron.daily/find
Hugh
More information about the LUG
mailing list