Mac OS X Navigate to Directory Alias
I’ve gotten really comfortable with navigating through my Mac’s directory file structure through the Terminal. There’s a certain feeling of powerfulness knowing I can do many if not all of the things I need to do with my computer without my fingers ever leaving the keyboard. As times goes by, I think everyone develops a certain level of muscle memory where users don’t even have to think about what they need to type when going into the Terminal to do what needs to be done.
One of the things that I’ve been doing a lot lately on the command line is changing directories to a set of folders that I keep going back to. I’m finding that whereever I left my computer previously in terms of the directory I’m in, I inevitably have to do one or more of the folliowing things:
- Check what directory I’m in - cd up to the right parent folder level - cd down to the folder I want to be in
Laziness is usually looked down upon, but in this particular case, my unwillingness to enter a few extra commands in the terminal is going to help me increase my productivity.
Here are the steps I took to get aliases going for me:
1.) Go to Home directory with ‘cd’ and enter ‘ls -lah’ command
2.) Create a .bash_profile file in the directory if it doesn’t exist
3.) Enter aliases per line in the following format:
alias ALIAS_NAME=‘ALIAS COMMAND1; ALIAS COMMAND 2′
So, for example, if I want to have an alias to do the ‘ls -lah’ command, I can create the following alias:
alias l=‘ls -lah’
And presto! I can use the ‘l command in my terminal and it will display the contents of whichever directory I’m in.











