ubuntu / linux trash-cli deleted files to the Recycle Bin similar mechanism to delete

welcome to my blog

Problem Description: in linux system rmcommand after deleting the files difficult to recover, had to find a professional data recovery team, the larger the file, the more complete recovery, but the cost is very expensive so it is best to have a similar mechanism to delete windows in the Recycle Bin. after deleted can be restored

Solution: Installtrash-cli

Source recommended by installing the latest version of the trash-cli, using sudo apt install trash-cli can be installed, but the installation of an older version of 2012, dysfunction, use the source code installation is very simple, just a simple four-step

The first step in. Click on the download link , click on the top of the latest version, now it is my latest version 0.17.1.14

Here Insert Picture Description

The second step Click "Source code (tar.gz)" to start the download

Here Insert Picture Description

The third step is to download a good archive trash-cli-0.17.1.14.tar.gzuploaded to the linux server, you can use scp command, for example scp path/to/trash-cli-0.17.1.14.tar.gz user@ip:~, then unzip the file after the upload is complete, executetar -zxvf trash-cli-0.17.1.14.tar.gz

The fourth step is to install trash-cli, extract the files into the folder cd trash-cli-0.17.1.14, execute sudo python setup.py installthe installation

Installation above are valid for all users on the linux server, if only installed for the current user, performpython setup.py install --user

Instructions for use

command effect
trash-put file_name Delete files / folders, delete folders without any arguments
trash-empty Empty the trash, the irreversible operation
trash-list Check the Recycle Bin files / folders, time will also delete the file
trash-restore Recover files from the recycle bin / folder, suggesting that lets you choose need to restore the files after executing the command / folder
trash-rm file_name Deleted from the Recycle Bin specified file / folder, which is completely removed

Where is the trash-put command to delete a file / folder on the?

Deleted files / folders will be placed in /home/user/.local/share/Trashthe directory
Deleted files / folders will be placed in /home/user/.local/share/Trashthe directory
Deleted files / folders will be placed in /home/user/.local/share/Trashthe directory

Examples of Use

#创建文件
touch temp.txt
#删除文件
trash-put temp.txt
#查看回收站的文件, 也能看到文件的删除时间
trash-list
#从回收站中恢复指定的文件
trash-restore temp.txt
#删除文件
trash-put temp.txt
#从回收站中删除指定的文件
trash-rm temp.txt
#查看回收站的文件, 也能看到文件的删除时间
trash-list temp.txt

To a Song

扬州慢
淮左名都,竹西佳处,解鞍少驻初程。过春风十里,尽荠麦青青。自胡马窥江去后,废池乔木,犹厌言兵。渐黄昏、清角吹寒,都在空城。
杜郎俊赏,算而今、重到须惊。纵豆蔻词工,青楼梦好,难赋深情。二十四桥仍在,波心荡、冷月无声。念桥边红药,年年知为谁生

扬州慢乃姜夔自度曲,其中原委,见词。这是一首乱后感怀之作。上片写词人初到扬州的所见所感。有虚写,有实写。“淮左名都”、“竹西佳处”,
主要出自词人之前对这座名城的耳闻,属虚写;“废池乔木”、“清角吹寒”,则是词人亲眼所见。正因有之前的耳闻,才有了当前的触目惊心。
下片以昔日繁华,反衬今日之萧飒、冷落。明月应该是今夕荣枯的唯一见证者吧!而冷月无声,一个“冷”字,生出无边凄凉。逢时必发的桥边红药,
是有情的吗?她年年花发,又是为谁而生呢?至此,一种旷古的幽怨,笼罩全篇
Published 489 original articles · won praise 101 · Views 150,000 +

Guess you like

Origin blog.csdn.net/littlehaes/article/details/103701146