bashrc: Improve cdtmp to include date in dir name

This commit is contained in:
Lexi / Zoe 2023-08-20 17:15:19 +02:00
parent cf777fad2d
commit 6d036476e4
Signed by: binaryDiv
GPG Key ID: F8D4956E224DA232
1 changed files with 6 additions and 4 deletions

View File

@ -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