- Open .bashrc using any text editor. I have used here gEdit.
- .bashrc will open with gEdit. Add the following line at the end of the file,
alias trash=”mv -t ~/.local/share/Trash/files –backup=t”
- Save this file and close gEdit. Close the terminal window and then open a new terminal.
- You can test your alias now. Here we have created an alias named trash that would send any file/folder to Trash/files folder.
Say you want to delete filename.pdf and for that purpose use the following command:
This would delete the file filename.pdf. You can delete folders in the same way. Multiple files/folders can also be deleted in the same way.
trash filename1 filename2