Tìm file trong MAC

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:

Tìm file lớn hơn 10Mb và xoá

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 {} \;

Advertisements

One thought on “Tìm file trong MAC

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s