Add rudimentary trash function

This commit is contained in:
Talia 2021-12-28 11:52:17 +01:00
parent cf14bde633
commit 7de5f862cb

13
fun/trash.sh Normal file
View file

@ -0,0 +1,13 @@
#!/bin/sh
trash() {
mkdir -p $HOME/.trash
if [ -z "$@" ]; then
find $HOME/.trash -type f -exec basename {} ';'
else
for file in "$@"; do
mkdir -p $HOME/.trash/$(dirname $(realpath $file))
mv "$file" $HOME/.trash/$(realpath $file)
done
fi
}