mac资源库中Group Containers文件夹内有一个文稿文件137G,可以删除吗?
'/Users/Apple/Library/Group Containers/group.com.apple.coreservices.useractivityd/shared-pasteboard'
在这个路径中的文件有137G,这个文稿是可以删除的吗?
MacBook Pro 16″, macOS 26.1
'/Users/Apple/Library/Group Containers/group.com.apple.coreservices.useractivityd/shared-pasteboard'
在这个路径中的文件有137G,这个文稿是可以删除的吗?
MacBook Pro 16″, macOS 26.1
这个看上去是连续互通剪切板的缓存。
裡面的都是暫存檔案,讓你可從 Mac A 拷貝,在 Mac B 貼上的功能,區網內會自動共享。
archives/* 是本機拷貝檔案時產生的(tar檔?),items/* 是從外機同步過來的
在區網內有兩台以上、登入相同 Apple ID 的蘋果設備,同時被操作使用時就會啟動這功能
功能性來說是良好的,但就爛在它的過期檔案不會自動刪除.
兩種方式可以避免它產生這些廢檔
第二個方法是無法跨設備黏貼檔案,但黏貼文字還是行的
對了,還有第三種方式
就是使用自動刪除舊檔的腳本,然後設定 Folder Action,把腳本跟 archives/ & items/ 兩個資料夾綁在一起
這樣每次資料夾內產生新檔案,就會自動觸發腳本去砍掉舊檔案
這方式可以使用完整的接力功能,也不會被廢檔塞滿空間
Applescript腳本 ("~/Library/Workflows/Applications/Folder Actions/delete_old_items.scpt")
property numberRecent : 2 -- 要保留的最新項目數量
property showNotification : false -- 砍掉舊項目時彈出通知
on adding folder items to this_folder after receiving added_items
set itemList to {}
tell application "Finder" -- 依據日期排序,列出所有舊項目
set innerItems to sort (items of folder this_folder) by modification date
repeat with i from 1 to (innerItems's length) - numberRecent
copy quoted form of POSIX path of (item i of innerItems as alias) to end of itemList
end repeat
end tell
if itemList ≠ {} then -- 砍掉舊項目
set {orgTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, " "}
do shell script "rm -rf " & (itemList as text)
set AppleScript's text item delimiters to orgTID
if showNotification then display notification "已刪除 " & (itemList's length as text) & " 個項目" with title "shared-pasteboard"
end if
delay 0.1
end adding folder items to
Folder Action 腳本的用法,自己搜尋一下
mac资源库中Group Containers文件夹内有一个文稿文件137G,可以删除吗?