Hacker News new | past | comments | ask | show | jobs | submit login

No need for stacks of `..`. Use this instead:

function up() { for i in $(seq 1 $1); do cd ..; done }

# usage:

up # goes up 1 directory

up 2 # goes up 2 directories

up 42 # goes up 42 directories




Nice little helper function, thank you. What do you think about renaming it to '..'? For me this feels a bit more natural:

  function ..() { for i in $(seq 1 $1); do cd ..; done }

  ..    # goes up 1 dir
  .. 2  # goes up 2 dirs 
  .. 42 # goes up 42 dirs




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: