trash¶
trash¶
brew install trash
trash <file>
macos-trash¶
https://github.com/sindresorhus/macos-trash
brew install macos-trash
trash <file>
¶
AppleScript¶
osascript -e "tell application \"Finder\" to delete POSIX file \"${PWD}/${InputFile}\""
trash() (
: "${1:?}"
case $1 in
(/*) FNAME="$1" ;;
(*) FNAME="$(pwd)/$1"
esac
export FNAME
exec osascript <<-EOF >/dev/null
set fName to system attribute "FNAME"
tell application "Finder" to delete my (POSIX file fName)
EOF
)
function rem {
for b in "$@"
do
osascript -e "tell app \"Finder\" to delete POSIX file \"${PWD}/$b\""
done
}
trash() { mv -fv "$@" ~/.Trash/ ; }
#
/Volumes/Sharon/Windows ❯ trash Windows10_InsiderPreview_Client_ARM64_en-us_21354.vhdx
copied 'Windows10_InsiderPreview_Client_ARM64_en-us_21354.vhdx' -> '/Users/bruno/.Trash/Windows10_InsiderPreview_Client_ARM64_en-us_21354.vhdx'
removed 'Windows10_InsiderPreview_Client_ARM64_en-us_21354.vhdx'
/Volumes/Sharon/Windows 25s 09:06:33
Dernière mise à jour:
November 9, 2023