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

I independently also have a stack of '...', '....' etc aliases almost exactly the same as this! Extremely useful I reckon!

Another thing that I've found surprisingly invaluable is an alias (i went for 'ccd') that figures out (via python, so a bit slower on the 1st run) what part of the argument is a valid directory and then cd's you there. It's very handy indeed when working with file paths all the time (a film-vfx-on-Linux use-case) otherwise you end up using backspace to delete the file part constantly! In fact, about that: hitting Esc-Backspace in sequence, should delete back to the next word separator instead of one char at a time.




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




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

Search: