Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-12-2006, 04:06 PM   #1
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, 04:18 PM   #2
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,138

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

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, 04:22 PM   #3
LQ Newbie
Registered: May 2004
Posts: 18

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


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 04:11 AM
Find question facets Linux - Newbie 3 03-04-2005 07:04 AM
find question coder22 Linux - Newbie 3 02-21-2005 07:11 AM
find -exec question eantoranz Linux - General 1 06-26-2004 10:57 AM
question on find pfunk Linux - General 4 07-10-2002 05:27 AM > Forums > Linux Forums > Linux - Newbie

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