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

nath
  • 5,694

1 Answers1

6

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

find . -type f -size +10M -exec mv "{}" new_folder/ \;
Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
nath
  • 5,694
  • 2
    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 '18 at 23:20
  • 2
    wary means cautious; weary means tired. – Tom Connolly Apr 23 '20 at 14:15