We Recommend

bash Cookbook: Solutions and Examples for bash Users bash Cookbook: Solutions and Examples for bash Users
bash Cookbook teaches shell scripting the way Unix masters practice the craft. It presents a variety of recipes and tricks for all levels of shell programmers so that anyone can become a proficient user of the most common Unix shell -- the bash shell -- and cygwin or other popular Unix emulation packages.


Posted By

chrisaiv on 05/13/08


Tagged

osx alias terminal


Versions (?)


Creating a Simple Alias in Terminal


Published in: Bash 


I use terminal for SFTP because I'm cheap and I don't want to purchase Transmit. SFTP works just fine but the problem is that I get tired of having to type [bash]$ sftp chrisaiv@blah.com:/directory/subdirectory/ so instead I've made an alias. First things first, in terminal using Textmate, type [bash]$ mate ~/.bash_alias. Next paste the code below. After you save the file, type [bash]$ ~/.bash_profile and past the second line of code. After you restart your terminal, you should only have to type the alias nickname and whala!


  1. #Place this in ~/.bash_alias
  2. alias nickname='sftp chrisaiv@domain.com:/public_html/directory/subdirectory/'
  3.  
  4. +++++++++++++++++++++++++++++++++++++++++++++++
  5.  
  6. #Place this in ~/.bash_profile
  7. source $HOME/.bash_alias

Report this snippet 

You need to login to post a comment.