Recently I did a stupid thing that using the command “rm -rf ./files/I/want/to/use” in fedora, so terrible and the data is hard to recovery.
I start alias the rm command in ~/.bashrc file with “alias rm=’mv $file /dev/null’”, but it cannot work and the error message is “cannot overwrite non-directory ‘/dev/null’ with directory ‘Item/“”, so I try to find out where the trash can is in the linux filesystem.
And then, I know the trash can is in the directory “/home/user/.local/share/Trash/files/“, whatever you delete in GUI, the files are in the trash can.So how do we delete files into trash can in command line?
There is a trash command line interface that you can use. To install do:
RPM:
sudo yum install trash-cli
DEBIN
sudo apt-get install trash-cli
Then trash files do:
trash files/you/want/to/move/to/trash
And you can find the files you trash in /home/user/.local/share/files/
You also can use trash-list, trash-empty……., and “man trash” to know more……
reference material:http://stackoverflow.com/questions/13532136/how-to-delete-a-file-to-the-trash-in-bash-linux