creating a menu for recycling and permanently deleting files.

Trying to alias rm to move files to a hidden trash directory in the bash shell. I've tried to create this alias numberous ways and it's just not working. Here's what I've tried, anyone have any suggestions.
alias rm='mv $* ~/.trash'
alias rm= 'mv$* ~/.trash'

things like that... I've also tried creating a function called my_rm_script that contains just the "'mv ..." part of the above.

None of it works! I've about lost patience with it. :mad:

The concept is to create an undelete function:
an alias for rm to place "deleted" files in a trash folder
give an option to recover files from the trash folder
and
a destroy function that basically unaliases rm briefly so that the files that are chosen to be deleted are permanently deleted from the ~/.trash folder.

Help Please?!?!?! :eek:

seems to me your command line is not getting the argument list correctly ... create a small script that does what you want and then alias rm with the script name ... make sure you don't call the script rm also ...

I FINALLY figured it out. The man pages are kind of confusing to a newbie.

rm='mv --target-directory=/home/directory name/ '

the file name goes at the end when you run the rm alias command. I was thinking the "unknown" file name that would be passed to the command had to be represented in the alias somehow. :slight_smile: :slight_smile: