从终端将文件移动到 Snow Leopard 上的废纸篓

mat*_*pie 13 terminal trash osx-snow-leopard

Snow Leopard 允许用户“放回”从 Finder 移至废纸篓的文件。但是,当我mv <file> ~/.Trash从命令行执行此操作时,我没有得到“放回”选项。

Snow Leopard 中是否有一个本地命令可以将文件移动到垃圾箱,同时让我仍然能够“放回”?

小智 9

我建议安装 Ruby gem osx-trash

如何?

sudo gem install osx-trash
Run Code Online (Sandbox Code Playgroud)

用法?

Usage: trash [OPTIONS] <file> [<file> ...]
       trash [-e | --empty]
       trash [-l | --list]
Specific options:
    -e, --empty                      Empty the trash
    -l, --list                       List items in the trash
    -h, --help                       Show this message
    -v, --version                    Show version

Manipulate to the Finder's trash.
Run Code Online (Sandbox Code Playgroud)

  • 好的!但是,当它与 Finder 通信时,使用通配符删除文件会为每个文件播放删除声音。 (2认同)

Jos*_*h K 2

当您将文件移至垃圾箱时,OS X 会使用“放回”信息更新.DS_Store其中的文件。~/.Trash有关更多详细信息,请参阅此问题

为了更新此.DS_Store文件,当您将文件移动到终端中的垃圾箱时,您还必须更新该文件。