Linux aliasing changing directories

Not terribly complicated or clever, but I wanted to try something different… and learn something.

alias u="cd .."
alias uu="u;u"
alias uuu="uu;u"
alias uuuu="uuu;u"
alias uuuuu="uuuu;u"
alias uuuuuu="for (( i=1; i<=6; i++ )) ; do cd .. ; done"
alias uuuuuuu="uuuuuu;u"

All this because I change directory levels like crazy, and often, in the shell. I worked out #6 when I was trying to figure out a way to count the number of U’s I typed. But then I reckoned that was too complicated, but didn’t want to completely lose it.

At least it is amusing to me.

I may try to figure out how to script this at some point and count the number of U’s or pass in a parameter.

Advertisements

About John

I write about technology interests, cooking, and my own writing (sci-fi and fantasy... sometimes both). I try to keep things light, but sometimes I get side-tracked on an issue that I feel strongly about. No offense is meant, I'm just like any other person who feels strongly about something when I write. View all posts by John

Comments are disabled.

%d bloggers like this: