LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Find command ? (https://www.linuxquestions.org/questions/linux-newbie-8/find-command-351589/)

hpladd 08-09-2005 02:41 PM

Find command ?
 
Why will
Code:

find / -iname xinitrc
return the following:

Code:

/etc/X11/xinit
/etc/X11/xinit/xinitrc.d
/etc/X11/xinit/xinitrc
/usr/X11R6/lib/X11/xinit
/usr/X11R6/bin/xinit
/usr/X11R6/man/man1/xinit.1x.gz

but not return:

/usr/lib/X11/xinit/xinitrc

I know the file is there. Please see the following ls command and its return.

Code:

[root@localhost root 03:31 PM]# ls /usr/lib/X11/xinit/
Xclients  xinitrc  xinitrc.d

Is the find command limited to searching a predefined path of directories? I didn't thin it was.

Thanks all

hpladd 08-09-2005 02:48 PM

corrected question
 
Why will the following command:
find / -iname "*xinitrc*"

return the following:
/etc/X11/xinit
/etc/X11/xinit/xinitrc.d
/etc/X11/xinit/xinitrc
/usr/X11R6/lib/X11/xinit
/usr/X11R6/bin/xinit
/usr/X11R6/man/man1/xinit.1x.gz

but not return:
/usr/lib/X11/xinit/xinitrc

I know the file is there as the ls command ls /usr/lib/X11/xinit/
returns:
Xclients xinitrc xinitrc.d

Is the find command limited to searching a predefined path of directories? I didn't thin it was.

Thanks all

Tinkster 08-09-2005 04:44 PM

To answer your question: no - find isn't limited to certain
search-paths. But the thing that REALLY puzzled me in
your output that it should be returning things like:
/usr/X11R6/lib/X11/xinit
/usr/X11R6/man/man1/xinit.1x.gz
if you search for *xinitrc*

What does
ls -l `which find`
say?


Cheers,
Tink

hpladd 08-09-2005 05:12 PM

I'm with ya. I'm confused too.

Code:

[root@localhost root 06:04 PM]# ls -l `which find`
-rwxr-xr-x    1 root    root        51028 Jan 24  2003 /usr/bin/find
[root@localhost root 06:04 PM]#

FYI
Code:

[root@localhost root 06:09 PM]# ls /usr/X11R6/lib/X11/xinit
Xclients  xinitrc  xinitrc.d
[root@localhost root 06:09 PM]# ls /usr/X11R6/man/man1/xinit.1x.gz
/usr/X11R6/man/man1/xinit.1x.gz


hpladd 08-09-2005 05:33 PM

I was messing with a --maxdepth # option the other day. I thought it was an option for the rpm --query command. But now I don't see --maxdepth as an rpm option.

Perhaps I inadvertantly reconfigured the find command with the --maxdepth option. But how I did it, I don't know.

Ah... such is my life as a newbie.

Tinkster 08-09-2005 09:42 PM

You didn't. Find won't set any "permanent options" unless
you explicitly define an alias with a certain invocation.

And it still doesn't explain why it should be using something
like a phonetic search. xinitrc shouldn't give you a xinit.
FULL STOP.


Cheers,
Tink


All times are GMT -5. The time now is 07:46 PM.