LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-12-2006, 05:06 PM   #1
burn0ut
LQ Newbie
 
Registered: May 2004
Posts: 18

Rep: Reputation: 0
Question find question


Hello, it's wierd, but nobody can give me the exact right answer on the following question:

Give a list of files (on the whole system) who have on the third place an 'o' OR a 't' in their name.

I tried to find possible solutions with find and the regex option, but find gives the total path, not the filenames. How can I solve the total question?
 
Old 01-12-2006, 05:18 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
Will this do what you want?

Code:
find / -type f -exec basename {} \; 2>/dev/null | egrep '^..[ot]'
I didn't try to remove duplicates or anything like that...
 
Old 01-12-2006, 05:22 PM   #3
burn0ut
LQ Newbie
 
Registered: May 2004
Posts: 18

Original Poster
Rep: Reputation: 0
Thx for your fast reply, some piping was really needed
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about FIND katsal Linux - General 4 04-28-2005 05:11 AM
Find question facets Linux - Newbie 3 03-04-2005 08:04 AM
find question coder22 Linux - Newbie 3 02-21-2005 08:11 AM
find -exec question eantoranz Linux - General 1 06-26-2004 11:57 AM
question on find pfunk Linux - General 4 07-10-2002 06:27 AM


All times are GMT -5. The time now is 01:08 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration