Ambium
  • 0
  • 1
  • 2

Archives | Blog (January-2010-21)

Back to: Blog
Thursday, 21. january 2010.

Find files larger than X and delete them in Mac OS/Unix terminal

Another terminal oneliner I've just used to delete files larger than 10mb.

So if you need to delete some files larger than X mb on your Mac or some unix server, here is the simple oneliner to do it, in this example we're looking for files larger than 10mb in current folder (and subfolders, because find command is recursive) and delete them:

find ./ -size +10000000c -exec rm {} \;

And to be sure that you'll be deleting the right files, you can first list them like this:

find ./ -size +10000000c -exec ls -la {} \;

Comment

Fresh One

Web

Ambium

  • 5.00
    • 1
    • 2
    • 3
    • 4
    • 5
(current rating: 5.00 | 1 votes)
Calendar

January 2010

  • mon
  • tue
  • wed
  • thu
  • fri
  • sat
  • sun
  •  
  •  
  •  
  •  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

December 2009

  • mon
  • tue
  • wed
  • thu
  • fri
  • sat
  • sun
  •  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

May 2009

  • mon
  • tue
  • wed
  • thu
  • fri
  • sat
  • sun
  •  
  •  
  •  
  •  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31