bashrc: Improve cdtmp to include date in dir name
This commit is contained in:
parent
cf777fad2d
commit
6d036476e4
|
|
@ -36,16 +36,18 @@ yay() {
|
||||||
command yay "$@"
|
command yay "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create and cd to tmp dir
|
# Create and cd to temporary directory ~/tmp/tmp.YYYYMMDD.XXXXXX or ~/tmp/tmp.$1.XXXXXX if an argument is given
|
||||||
alias cdtmp='cd $(mktemp -d -p ~/tmp/)'
|
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() {
|
function mkcd() {
|
||||||
mkdir -p "$1"
|
mkdir -p "$1"
|
||||||
cd "$1"
|
cd "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
# cd to dir + ll (ls -la)
|
# cd into dir + ll (ls -la)
|
||||||
function cdll() {
|
function cdll() {
|
||||||
cd "$1"
|
cd "$1"
|
||||||
ls -la
|
ls -la
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue