Find the answer to your Linux question:
Results 1 to 2 of 2

Thread: using find

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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
    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.
    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