昨日分享了在 macOS 用 trash 取代 rm 刪除文件。可以將要刪除的檔案放在垃圾桶 ( Bin
/ Trash
/ Recycle Bin
) 裡,方便有需要時可以尋回。
今天輪到 Linux 了,分享的是 trash-cli.
安裝
其中,Debian / Ubuntu 的安裝方式為:
sudo apt install trash-cli
使用方法
隨後就有多幾個簡單 command 可以對 trash can 進行操作:
trash-put trash files and directories.
trash-empty empty the trashcan(s).
trash-list list trashed files.
trash-restore restore a trashed file.
trash-rm remove individual files from the trashcan.
其中 trash-put
可以直接打 trash
執行。
建議前往 Github Repo 看一遍 Usage.