executivechimp, 1 year ago Good article. Rather than aliasing `cd …/…" etc. I’ve got this function in my setup: <span style="color:#323232;">up () { </span><span style="color:#323232;"> local x='' </span><span style="color:#323232;"> for i in $(seq ${1:-1}) </span><span style="color:#323232;"> do </span><span style="color:#323232;"> x="$x../" </span><span style="color:#323232;"> done </span><span style="color:#323232;"> cd $x </span><span style="color:#323232;">} </span> This lets me do up 4 to go up 4 directories.
Good article. Rather than aliasing `cd …/…" etc. I’ve got this function in my setup:
<span style="color:#323232;">up () { </span><span style="color:#323232;"> local x='' </span><span style="color:#323232;"> for i in $(seq ${1:-1}) </span><span style="color:#323232;"> do </span><span style="color:#323232;"> x="$x../" </span><span style="color:#323232;"> done </span><span style="color:#323232;"> cd $x </span><span style="color:#323232;">} </span>
This lets me do up 4 to go up 4 directories.
up 4