Re: [SLUG] find ot locate binary

2004-11-22 Thread Simon Bryan
Thanks all, prompt advice as always, has got me on the way out of another
hole of my own making!  :-)


On Mon, November 22, 2004 12:43 pm, Erik de Castro Lopo said:
 On Mon, 22 Nov 2004 11:30:29 +1100 (EST)
 Simon Bryan [EMAIL PROTECTED] wrote:

 Hi,
 If I just want to 'find' or 'locate' a file called xyz rather than all
 directories and filenames that contain that string what would I enter at
 the command line?

 For files:

find / -name xyz -type f

 For directories:

find / -name xyz -type d

 Erik


-- 
Simon Bryan
IT Manager
OLMC Parramatta
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


[SLUG] find ot locate binary

2004-11-21 Thread Simon Bryan
Hi,
If I just want to 'find' or 'locate' a file called xyz rather than all
directories and filenames that contain that string what would I enter at
the command line?


-- 
Simon Bryan
IT Manager
OLMC Parramatta
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


RE: [SLUG] find ot locate binary

2004-11-21 Thread Visser, Martin
A quick and dirty reply (using the locate database)  

export lookfile=gcc;locate $lookfile | grep -e .*/$lookfile$

This will find the file gcc (only). .*/ is greedy and should eat up
all directory names up to the last /

Of course Jill's find solution will look at the running filesystem
whereas locate only looks at the updatedb database since it was last
updated. (locate will be far quicker of course)

Martin

Martin Visser ,CISSP
Network and Security Consultant 
Consulting  Integration
Technology Solutions Group - HP Services

3 Richardson Place 
North Ryde, Sydney NSW 2113, Australia 

Phone: +61-2-9022-1670
Mobile: +61-411-254-513
Fax: +61-2-9022-1800 
E-mail: martin.visserAThp.com
 
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Simon Bryan
 Sent: Monday, 22 November 2004 11:30 AM
 To: [EMAIL PROTECTED]
 Subject: [SLUG] find ot locate binary
 
 Hi,
 If I just want to 'find' or 'locate' a file called xyz rather 
 than all directories and filenames that contain that string 
 what would I enter at the command line?
 
 
 --
 Simon Bryan
 IT Manager
 OLMC Parramatta
 --
 SLUG - Sydney Linux User's Group Mailing List - 
 http://slug.org.au/ Subscription info and FAQs: 
 http://slug.org.au/faq/mailinglists.html
 
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] find ot locate binary

2004-11-21 Thread Jamie Wilkinson
This one time, at band camp, Simon Bryan wrote:
Hi,
If I just want to 'find' or 'locate' a file called xyz rather than all
directories and filenames that contain that string what would I enter at
the command line?

find / -type f -name xyz
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html