From 57288bb4351d62de126848164d92b4ea9f7c3a24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Mon, 6 Nov 2023 14:17:31 +0100 Subject: [PATCH] feat(aliasrc): use trash instead of rm if available --- aliasrc.zsh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/aliasrc.zsh b/aliasrc.zsh index d8044e1..870c3be 100644 --- a/aliasrc.zsh +++ b/aliasrc.zsh @@ -77,7 +77,14 @@ alias p='ps -f' alias sortnr='sort -n -r' alias unexport='unset' -alias rm='rm -i' +# Use trash instead of rm if available +if command -v trash &> /dev/null +then + alias rm='trash' +else + alias rm='rm -i' +fi + alias cp='cp -i' alias mv='mv -i'