up -- useful bash alias
Works in bash and zsh; saves me from typing "cd ../../../../../.." etc when navigating deeply-nested directory structures (like for Java projects).
Usage: up [N]
For example: "up 11" is equivalent to "cd .." 11 times. Just "up" is equivalent to "cd .."
up () {
if (( $# != 1 ))
then
cd ..
else
upstr="."
for i in {1..$1}
do
upstr="$upstr/.."
done
cd $upstr
fi
}
Written by Spencer Williams
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#