LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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-03-2003, 02:55 PM   #1
snocked
Member
 
Registered: Dec 2002
Location: St. Louis, MO
Distribution: Slackware 9.1
Posts: 482

Rep: Reputation: 30
Question ls entire subdirectory tree


How would I list one file in the entire /usr subdirectory tree named needle from /usr? This file is 3 levels deep, but I don't know it's location. I need to know how to do this from a command line.

I know I'd use ls and a wildcard, but I know there's more I'm missing.

Thanks in advance.
 
Old 03-03-2003, 02:57 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
'locate filename' ?
 
Old 03-03-2003, 03:07 PM   #3
snocked
Member
 
Registered: Dec 2002
Location: St. Louis, MO
Distribution: Slackware 9.1
Posts: 482

Original Poster
Rep: Reputation: 30
warning: locate: could not open database: /var/lib/slocate/slocate.db: No such file or directory

Hmm, I just installed Slackware too.
 
Old 03-03-2003, 03:16 PM   #4
jkrohn
Member
 
Registered: Jan 2003
Location: Urbana, IL
Distribution: Slackware, Mandrake
Posts: 62

Rep: Reputation: 15
Run updatedb as root to create the databse. I would also reccomend to setup a cron job to keep the database up to date.

As far as locating the file, are you looking for its complete path? Or just to verify its existence.
 
Old 03-03-2003, 03:17 PM   #5
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
'slocate -u' to create the database. Do it. It's useful.
 
Old 03-03-2003, 06:43 PM   #6
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
locate is better, but for one-time use:

find /usr -name filename

(this is very slow)
 
Old 07-27-2006, 08:29 PM   #7
RMLinux
Member
 
Registered: Jul 2006
Posts: 260

Rep: Reputation: 37
try to use ls | grep [filename]
or whereis [filename]
 
  


Reply



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
where is my subdirectory blotch Linux - Newbie 22 06-18-2005 11:43 AM
Clam AV subdirectory search RadonicMan Linux - Software 1 09-06-2004 04:06 PM
the bible = the tree of the knowledge of good and evil () Jesus = the tree of life Michael111 General 2 04-14-2004 04:28 PM
sftp subdirectory how to ?? x2000koh Linux - General 1 12-16-2002 01:32 AM
need a P-Tree (Patricia Tree) library manaskb Programming 1 11-02-2002 06:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:23 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
Open Source Consulting | Domain Registration