I tend to eliminate repetitive tasks at the earliest possible opportunity. It's partly because I'm lazy, but mostly because I don't like wasting time or energy. In other words, I appreciate efficiency.

When on the command line I'm frequently moving between directories, often going several levels deep before having to resurface to move into another. Far too often this means I end up having to type:

cd ../../../../

The solution was to write a small bash function in my ~/.bash_profile. This is it:

function up {

  cwd=$(pwd);
  cds="";
  i=0;

    # If we have an argument and it's > 1, proceed.
  if [ $1 ] && [ $1 -gt 0 ]
  then

    i=$1

    # Add the levels to the string.
    while [ "$i" -ne "0" ]; do
      cds="$cds../";
      i=$(expr $i - 1);
    done

    # Excute the command.
    cd "$cds"
  else                                                                          
    cd ../
  fi

}

Now, instead of a cd plus multiple ../, I can just type:

up 4

It was easier to write the function than find a script that already did the same thing. Feel free to use it.