alias mkdir='mkdir -v'
alias mv='mv -v'
alias cp='cp -v'
alias rm='rm -v'
alias ln='ln -v'
但是删除 node_modules 的时候我一般
Several commands of trash
Before we using
trash command, we need to install it first.
sudo apt install trash-cli
trash-list to check whether there are any deleted files in Trash
But at the beginning, if there is no file, no information will be displayed here.
trash to delete files
Suppose I have two files that I want to delete, called 01.txt and 02.txt.
trash 01.txt 02.txt
Use a space to separate the two files, you can see that these two files are no longer under the current folder. At this time, use
trash-list to confirm that the file is under Trash, and you should see information like this:
2020-08-04 20:38:40 /home/clay/02.txt 2020-08-04 20:38:40 /home/clay/01.txt
Record the time of deletion and the file path before deletion.
restore-trash to restore files
If you want to restore the files in Trash, you can enter:
restore-trash 0 2020-08-04 20:38:40 /home/clay/02.txt 1 2020-08-04 20:38:40 /home/clay/01.txt What file to restore [0..1]:
Suppose you want to restore 02.txt, then you have to enter its number 0.
This is a little troublesome when restoring a large number of files… In fact, it can be copied directly from the path of
~/.local/share/Trash/files/ with the
cp command. It is recommended not to use the
mv command to move directly, or to cause confusion in the subsequent
4. Fourth, use trash-empty to empty all files in Trash
It's very simple, use directly:
All files under Trash will be deleted. However, just like the
rm command, you must first make sure that there are all unnecessary files.
In the end, I think even if there are more insurance steps, the possibility of accidentally deleting the mistake will always be there. The most important thing is that users must carefully confirm the instructions they have given. This is the way to cure the root cause.
本作品采用 知识共享署名-相同方式共享 4.0 国际许可协议 进行许可。