Oye! I couldn’t believe I did ‘rm -rf’ on my project folder! again!
Has this happened to you? If yes, read on.
Undo ‘rm -rf’
Add an alias of ‘rm’ command in ‘bashrc’ file. Alias is a command in linux which enables the replacement of a string with another. ‘alias’ is also capable of replacing or modifying BASH commands. ( wiki article )
To make ‘rm’ undo-able, we can define an alias to ‘mv’ or move the deleting files to system’s Trash folder.
Imeplementation
Edit your ‘.bashrc’ file and add the following line.
alias rm=’mv -t ~/.local/share/Trash/files/’
Save and exit. That’s it done.
Don’t Miss a Thing! Subscribe Us |
|||
![]() |
![]() |
![]() |
![]() |










Sorry, the comment form is closed at this time.If you want to send me a message you can use the contact form available here.