diff --git a/.bashrc.d/10_common_aliases.sh b/.bashrc.d/10_common_aliases.sh index f673c29..5fbb3f3 100644 --- a/.bashrc.d/10_common_aliases.sh +++ b/.bashrc.d/10_common_aliases.sh @@ -36,16 +36,18 @@ yay() { command yay "$@" } -# Create and cd to tmp dir -alias cdtmp='cd $(mktemp -d -p ~/tmp/)' +# Create and cd to temporary directory ~/tmp/tmp.YYYYMMDD.XXXXXX or ~/tmp/tmp.$1.XXXXXX if an argument is given +function cdtmp() { + cd $(mktemp -d -p ~/tmp tmp.${1:-$(date +%Y%m%d)}.XXXXXX) +} -# Make dir and cd to it (from Mara) +# Make dir and cd into it (from Mara) function mkcd() { mkdir -p "$1" cd "$1" } -# cd to dir + ll (ls -la) +# cd into dir + ll (ls -la) function cdll() { cd "$1" ls -la