Adds cdw alias

This commit is contained in:
Thomas Forgione 2022-04-19 11:25:37 +02:00 committed by Thibault Blanc-Beyne
parent 1920d0d9e1
commit 01596d9078
1 changed files with 8 additions and 0 deletions

View File

@ -60,6 +60,14 @@ mkcd() {
mkdir $1 && cd $1
}
# which && cd
cdw() {
f=`which $1`
if [ $? -eq 0 ]; then
cd `dirname $f`
fi
}
# Initialize thefuck
command -v thefuck > /dev/null 2>&1