Editing How to create a Recycle Bin (or Trash can) for the CLI rm command

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 35: Line 35:
#Save changes to the file and close vi, e.g. press [ESC] and then type "ZZ". Note: capital Z's
#Save changes to the file and close vi, e.g. press [ESC] and then type "ZZ". Note: capital Z's
#Now give the script file execution privileges, "chmod 700 rm_replacement.sh"
#Now give the script file execution privileges, "chmod 700 rm_replacement.sh"
#Now add the alias command to the /etc/profile file, e.g "vi /etc/profile", and then add at the bottom of the file "alias rm='sh /volume1/my_scripts/rm_replacement.sh'". Note the single quote at the end of this line!
#Now add the alias command to your .profile file, e.g "vi ~/.profile", and then add at the bottom of the file "alias rm='sh /volume1/my_scripts/rm_replacement.sh'". Note the single quote at the end of this line!
#Close the CLI session and re-open it again to get ash to read the modified .profile file
#Close the CLI session and re-open it again to get ash to read the modified .profile file
#Your script will now run instead of rm, try "rm -h" to get the help. If you want to check its operation by creating a directory and some files and delete them using rm. Check the content of the RecycleBin with "dir /volume1/RecycleBin".
#Your script will now run instead of rm, try "rm -h" to get the help. If you want to check its operation by creating a directory and some files and delete them using rm. Check the content of the RecycleBin with "dir /volume1/RecycleBin".
Please note that all contributions to wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wiki:Copyrights for details). Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)