12
sarena
4y

The joy that is the difference between `cd ..` and `cd..` is unexplainable

Comments
  • 1
    @highlight

    # Goes up as many dirs as the number passed as argument, if nonne, goes up by 1 by default

    up () {

    local d=""

    limit=$1

    for ((i=1 ; i <= limit ; i++))

    do

    d=$d/..

    done

    d=$(echo $d | sed 's/^\///')

    if [ -z "$d" ]; then

    d=..

    fi

    cd $d

    }
  • 2
    Zsh. 🙂
    I just type `..` now.
    I also defined `...` through `......` for convenience.
    (And `treee` through `treeeeee`!)
  • 1
    @Jilano yes and now batch please.
  • 0
    I always have to alias "cd.." in bash as it's muscle memory at this point and i can type it way faster than "cd .."
  • 2
    @Root I agree! Zsh is one of the best things to have happened to me
  • 0
    Uh, cd is the command and .. the parameter? How difficult is that?
Add Comment