mediatribe.net -- Drupal and Web Development

Notice: this post was last updated 6 years 15 weeks ago so it might be outdated. Please be cautious before implementing any of suggestions herein.

Using aliases to navigate the command line

I need to have access to several ssh servers, and several paths throughout my working day. I'm a very unsophisticated command line user, so for others out there who would like to tame the command line, here's a trick:

vi ~/.bash_profile

Add, at the very end
alias go-whatever='cd /path/to/whatever'
alias go-client='ssh me@client.com'
#etc.

Then, to make aliases permanent
source ~/.bash_profile

And to list aliases:
alias

This, combined with the use of public-private key pairs, lets me work without (almost) ever having to remember paths, or passwords.

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h3>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.