darkrc/fun/trash.sh

14 lines
273 B
Bash
Raw Normal View History

2021-12-28 10:52:17 +00:00
#!/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
}