Answers:
废纸actually实际上是用户名为的文件夹中的隐藏文件夹 .Trash
如果删除其中的内容,则清空垃圾箱。您可以使用
rm -rf ~/.Trash/*
请小心,以免删除其他内容;)
概述了用于从命令行管理垃圾桶的各种命令行工具:
http://hasseg.org/blog/post/406/trash-files-from-the-os-x-command-line/
如果安装了Homebrew,则可以通过键入以下内容轻松安装垃圾桶:
brew install trash
然后,要清空垃圾箱,只需从命令行键入以下内容:
trash -e
这是一个很小的软件。
$ trash
usage: trash [-ulesv] <file> [<file> ...]
Move files/folders to the trash.
Options to use with <file>:
-a Use system API for trashing files instead of asking
Finder to do it. (Faster, but the 'put back' feature
in the Finder trash will not work if files are trashed
using this method.) Finder is still used for trashing
files you have no access rights for.
-v Be verbose (show files as they are trashed, or if
used with the -l option, show additional information
about the trash contents)
Stand-alone options (to use without <file>):
-u Check for updates (and optionally auto-update self)
-l List items currently in the trash (add the -v option
to see additional information)
-e Empty the trash (asks for confirmation)
-s Securely empty the trash (asks for confirmation)
Options supported by `rm` are silently accepted.
Version 0.8.5
Copyright (c) 2010 Ali Rantakari, http://hasseg.org/trash
osascript -e 'tell app "Finder" to empty'
尽管您可能希望放入shell脚本以避免每次都必须正确获取语法)。