find . -size +10240k -exec stat -c%s" "%n {} \; | sort -rn

Find files of particular size in a directory


0
2012-02-16 10:36:48

These Might Interest You

  • This is for bash - make an alias - also a good blueprint for making aliases that take arguments to functions. If for Solaris use "-size +${1}000000c" to replace "-size +${1}M" Show Sample Output


    0
    alias big='BIG () { find . -size +${1}M -ls; }; BIG $1'
    greggster · 2011-03-10 06:33:00 1
  • the command will calculate the size of hidden files Show Sample Output


    1
    find directory -maxdepth 1 -type f | xargs ls -l | awk 'BEGIN { SUM=0} { SUM+=$5 } END { print SUM/2^20 }'
    emacs · 2010-06-04 01:55:01 0

  • 0
    find . -type f -size +50000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
    maheshmahajan · 2014-06-24 07:24:39 0
  • Prints the size of Directory in human readable format like KB MB or GB. If you want to see size each files and directories inside the directory use -a option as shown in second output and if you want a total sum then add -c option :) Show Sample Output


    -6
    du -h <Directory>
    Vasudev · 2010-06-04 03:14:37 0
  • Provides a recursive time ordered list of the current directory over the last 3 minutes. Excluding zero byte files: ls -lF -darth `find . -size +0 -mmin -3` For the last day's files, change "-mmin -3" to "-mtime -1": ls -lF -darth `find . -size +0 -mtime -1` Show Sample Output


    -2
    ls -lF -darth `find . -mmin -3`
    UncleLouie · 2014-03-22 16:52:20 0
  • Remove all zero size files from current directory. Its a not recursive option like: find . -size 0c -exec rm {} \;


    -8
    ls -s|grep -E "^ *0"|sed "s/^ *0 //g"|xargs -i rm "{}"
    glaudiston · 2012-04-18 14:50:46 3

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: