Skip to main content
edits for safety and clarity
Source Link
ryantuck
  • 219
  • 1
  • 8

Here's a pretty trivial one-line solution to add to your bash profile. Note that it will overwrite something with a similarthe same name in the trash already.

trash() { mv -ffv $@"$@" ~/.Trash/ ; } 

Usage:

• ~/Desktop $$$ touch a b c • ~/Desktop $$$ ls a b c • ~/Desktop $$$ trash a b c a -> /Users/ryan.tuck/.Trash/a b -> /Users/ryan.tuck/.Trash/b c -> /Users/ryan.tuck/.Trash/c • ~/Desktop $$$ ls • ~/Desktop $$$ 

Here's a pretty trivial one-line solution to add to your bash profile. Note that it will overwrite something with a similar name in the trash already.

trash() { mv -f $@ ~/.Trash/ ; } 

Usage:

• ~/Desktop $$$ touch a b c • ~/Desktop $$$ ls a b c • ~/Desktop $$$ trash a b c a -> /Users/ryan.tuck/.Trash/a b -> /Users/ryan.tuck/.Trash/b c -> /Users/ryan.tuck/.Trash/c • ~/Desktop $$$ ls • ~/Desktop $$$ 

Here's a pretty trivial one-line solution to add to your bash profile. Note that it will overwrite something with the same name in the trash already.

trash() { mv -fv "$@" ~/.Trash/ ; } 

Usage:

• ~/Desktop $$$ touch a b c • ~/Desktop $$$ ls a b c • ~/Desktop $$$ trash a b c a -> /Users/ryan.tuck/.Trash/a b -> /Users/ryan.tuck/.Trash/b c -> /Users/ryan.tuck/.Trash/c • ~/Desktop $$$ ls • ~/Desktop $$$ 
Source Link
ryantuck
  • 219
  • 1
  • 8

Here's a pretty trivial one-line solution to add to your bash profile. Note that it will overwrite something with a similar name in the trash already.

trash() { mv -f $@ ~/.Trash/ ; } 

Usage:

• ~/Desktop $$$ touch a b c • ~/Desktop $$$ ls a b c • ~/Desktop $$$ trash a b c a -> /Users/ryan.tuck/.Trash/a b -> /Users/ryan.tuck/.Trash/b c -> /Users/ryan.tuck/.Trash/c • ~/Desktop $$$ ls • ~/Desktop $$$