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

What is the unix command to find files that are in one directly buy not another directory? I only care about file names.


share|improve this question
Well, I can say ls dir1 dir3 dir5. If that’s not what you’re looking for, please clarify your question. – Scott Feb 26 '13 at 22:39

I'm assuming you want to do this search from a higher level directory. If so, you can use the -path option with find.

For example, given the directory structure below


to find files matching 'test*' in dir1 use

find -path '*dir1*' -iname 'test*'
share|improve this answer

You must log in to answer this question.

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