LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 03-08-2011, 11:34 AM   #1
grob115
Member
 
Registered: Oct 2005
Posts: 528

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, 11:35 AM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,411
Blog Entries: 1

Rep: Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115
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, 11:37 AM   #3
corp769
Guru
 
Registered: Apr 2005
Posts: 5,814

Rep: Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001
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, 11:43 AM   #4
catkin
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,563
Blog Entries: 29

Rep: Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179
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.
  


Reply


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


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


All times are GMT -5. The time now is 08:15 PM.

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