Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've wondered recently if there is any way to look for archives|pics|media in Linux dirs? I can do it using the find command like this:

find ./ -iname "*.tar" 

or

find ./ -regex ".*\(jpg\|tar\|avi\)$"

But what if the needed file doesn't have an extension? How do I search for it? Any ideas?

share|improve this question
up vote 3 down vote accepted

You can use find + file:

For example, if you are looking for ASCII text, regardless of extension:

find -exec file {} \; | grep ASCII
share|improve this answer
1  
slightly optimize version: find -type f -exec file {} \; | grep ASCII – Sachin Divekar Nov 23 '11 at 14:58
    
very nice, didn't know that, thanks! – openme1984 Nov 23 '11 at 15:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .