2

How can I move all files bigger than lets say 10MB into a different folder?

-rw-r--r-- 1 nath nath 4,3M Apr 21  2018 "file1.mp3"
-rw-r--r-- 1 nath nath 1,7M Jun 10  2017 'file2.mp3'
-rw-r--r-- 1 nath nath  76M Okt 12 05:33  file3.mp3
-rw-r--r-- 1 nath nath 3,7M Mär  1  2016 'file4.mp3'

so in this case it would only move file3

0

1 Answer 1

6

Ok 5 minutes after posting the question I found the answer:

find . -type f -size +10M -exec mv "{}" new_folder/ \;
2
  • 1
    There is nothing wrong with answering your own question. Be weary that on certain versions of find this command will not work as expected. It may not even fail but instead may just move all files regardless of size.
    – jesse_b
    Nov 28, 2018 at 23:20
  • 2
    wary means cautious; weary means tired. Apr 23, 2020 at 14:15

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