Find the answer to your Linux question:
Results 1 to 2 of 2
i need to find a series of files in a directory that are greater than 300 kilobytes in size i tried using the -size option but this does not appear ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2007
    Posts
    3

    Exclamation using find


    i need to find a series of files in a directory that are greater than 300 kilobytes in size i tried using the -size option but this does not appear togive me the correct files first am i using the correct option and does anyone have a better solution for extracting these files as they need to be copied to another directory for processing

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,217
    Code:
    find <SOURCEDIR> -type f -size +300k | xargs -n10 -I {} mv  {} <DESTINATIONDIR>
    Be aware, that <SOURCEDIR> is traversed, while <DESTINATIONDIR> will be flat.
    So files with the same names will be overwritten by the mv, and effectively all but one file is deleted.
    If you dont want that, replace mv with cp (and appropiate arguments).

    Another approach would be to use rsync.
    Look at the --min-size option.
    Code:
    man rsync
    You must always face the curtain with a bow.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •