Bash back function
function to quickly navigate file system:
function .. (){
local arg=${1:-1};
local dir=""
while [ $arg -gt 0 ]; do
dir="../$dir"
arg=$(($arg - 1));
done
cd $dir >&/dev/null
}
You can issue cd .. with
..
with number at the end it will repeat itself n times like so:
.. 3
which translates to
cd .. ; cd .. ; cd ..
Written by Jacek Dominiak
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Function
Authors

Chip Castle
21.7K

deleteman
10.11K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#