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

Is it possible to search for files with a certain filename and size in linux?

share|improve this question
up vote 2 down vote accepted

With the following command you can search for files with .log and size over 100k in the actual directory.

find ./ -type f -size +100k -name "*.log"
share|improve this answer
3  
Wrap the argument to -name in quotes to avoid it being expanded by the shell if a file matching the wildcard exists in the current directory. Also, find searches according to the criteria in the order they are given, and the name lookup is the fastest, so make it a habit to put the -name directive before -type and other directives that requires stat calling on files. See the second example given in the GNU find manual for a reference. – Daniel Andersson Aug 2 '12 at 10:26
    
Thx for the comment, i wrap the argument in quotes. – kockiren Aug 2 '12 at 10:29

You must log in to answer this question.

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