Currently seeking new career opportunities in web development, particularly with Laravel, Hire Me

Creating an alias in terminal

David Carr

Tutorials Bash

I often run local sites from a projects folder that is stored in a dropbox folder the full path is long, so instead of using the full path I create an alias in the terminal which is a shortcut to that path. This means instead of typing:

cd ~/"Dropbox (Personal)/projects

I can type:

projects

To do this open your bash profile:

nano ~/.bash_profile

Then create the alias:

#alias
alias projects='cd ~/"Dropbox (Personal)/projects"'

Restart the terminal then type your shortcut and press enter to be taken to the aliased location.

Aliases are really useful and simple to set up.

Laravel Modules Your Logo Your Logo Your Logo

Become a sponsor

Help support the blog so that I can continue creating new content!

Sponsor

My Latest Book

Modular Laravel Book - Laravel: The Modular way

Learn how to build modular applications with Laravel Find out more

Subscribe to my newsletter

Subscribe and get my books and product announcements.

Learn Laravel with Laracasts

Faster Laravel Hosting

© 2006 - 2024 DC Blog. All code MIT license. All rights reserved.