Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


LinkBack Search this Thread
Old 03-08-2011, 10:34 AM   #1
Registered: Oct 2005
Posts: 519

Rep: Reputation: 32
find command on subdirectories

Believe the find command should search in all subdirectories but for some reason it doesn't on a box I'm working on. For example, if I have the following
find / -name test

It wouldn't find the file /etc/mydir/test, if I execute the command in /etc. Can someone please explain what I need to do to enable search also in the subdirectories recursively?
Old 03-08-2011, 10:35 AM   #2
Senior Member
Registered: Aug 2006
Distribution: Arch 2014.02.01
Posts: 2,317
Blog Entries: 1

Rep: Reputation: 741Reputation: 741Reputation: 741Reputation: 741Reputation: 741Reputation: 741Reputation: 741
You have to be running the command as 'root' to be able to search through system directories.
0 members found this post helpful.
Old 03-08-2011, 10:37 AM   #3
Registered: Apr 2005
Posts: 5,798

Rep: Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978
To add to that, the find command by default searches recursively. I normally use the find command along with grep to find what I need to.
1 members found this post helpful.
Old 03-08-2011, 10:43 AM   #4
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,514
Blog Entries: 27

Rep: Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174
The find command you are using should list subdirectories.

If permissions prevent find reading subdirectories, it will give an error message.

Maybe find is not running /usr/bin/find; what is the output of which find?
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Find not searching subdirectories JosephS Linux - Software 6 07-12-2010 10:16 PM
[SOLVED] command to find a specific word in directories and subdirectories? siranjeevi Linux - Newbie 4 06-09-2010 09:19 AM
Find files in current directory, not subdirectories SmurfGGM Linux - Newbie 1 10-09-2008 12:14 PM
Command "find" misses some subdirectories vallond Linux - Enterprise 0 07-19-2007 04:55 AM
Evolution can't find libs in its own subdirectories slackist Linux - Software 3 03-16-2005 09:49 AM

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration