Delete OS X dot files using Automator 刪除Mac系統檔案

插入USB隨身碟後,都會產生

.ds_store

.trash

._

很多點點點的檔案

現在我們來做個服務,刪除這些檔案吧!

首先打開Automator

選擇服務

設置 服務接收所選的“檔案夾”,位置”Finder.app”

可以做個自定義的要求確認 (去左邊選項拉一個過來)Automator2

接下來在新增 執行shell工序指令

dot_clean -m -keep=mostrecent "$@"

find "$@" -name ".DS_Store" -exec rm {} \;

rm -f "$@"/.VolumeIcon.icns
rm -Rf "$@"/.fseventsd
rm -Rf "$@"/.TemporaryItems
rm -Rf "$@"/.Spotlight-V100
rm -Rf "$@"/.Trashes

Automator1完成儲存!

之後再Finder裡,便可以在檔案夾點擊右鍵,選取最下方的服務,刪除這些系統檔案囉!

Advertisements

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