« Back to blog

Project Directory Aliasing for Quick Terminal Access

I build a lot of sites for a lot of different clients and have been perfecting my directory structure over the last few years. Because I heavily rely on Terminal to work on projects, I need very fast access requiring little thought to my project directories. At the same time I need projects organized by client so I use this rather obvious structure (these are not my actual clientsI wish!):

Keeping directory names lowercase and avoiding spaces makes for easier tab-completion on terminal.

Even so, typing cd ~/work/rivendell_bicycle_works/rivendell.com (albeit only actually typing cd ~/wo[tab]/riv[tab]/riv[tab]) is too much work when my mind is full of code and I need to get somewhere quick on a new terminal.

Enter aliasing. Aliasing allows me to open a new terminal and type cd riv[tab] and find myself in ~/work/rivendell_bicycle_works/rivendell.com. To facilitate this surprisingly useful ability, I setup an alias at the start of each new project.

When I no longer need quick access to a project, I can just delete the alias to keep my home directly clean(ish).