Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@curquiza
Created October 23, 2017 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save curquiza/b44d761a510b473701ac74aa96a67db0 to your computer and use it in GitHub Desktop.
Save curquiza/b44d761a510b473701ac74aa96a67db0 to your computer and use it in GitHub Desktop.
Move yours files in your trash
#!/bin/bash
if [ ! -d ~/.Trash ]
then
echo "rmtrash: the directory ~/.Trash does not exist"
exit
fi
for file in $@
do
if [ -e $file ]
then
if [ -e ~/.Trash/$file ]; then
rm -rf ~/.Trash/$file
fi
mv $file ~/.Trash
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment