Ubuntu terminal operation setting behavior trash

Ubuntu set the terminal operating behavior of the Recycle Bin (by default, delete files in the terminal, directly deleted)

Reference from: https://help.aliyun.com/knowledge_detail/41359.html?spm=5176.2000002.0.0.3afb1ee6ZrTO8Y


1. Create a new recycle bin directory(the directory path and name actually can be customized)

 

 

2. vim / bin / Trash editing a file.

  1. mv $@ /tmp/trash_tmp
  2. :x 保存退出

 

 

3 . Invim / etc / environmentshown in FIG bottom added content file. (No such file to create a new one)

  alias rm = / bin / bash add an alias

 

 

4 . Source / etc / Environment enabled environment variable.

 

5 . Test delete files a.txt , the results were shown to perform rm command, it found a.txt file has been placed in the recycle bin to set the beginning of the directory.

 

 

6. If you want to really delete a file by the time the following manner:

  /bin/rm -<文件名>

 

 

Guess you like

Origin www.cnblogs.com/lowmanisbusy/p/10985978.html