|
|
|
|
|
by danwills
1885 days ago
|
|
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. |
|
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