Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Mac at work and my coworker set up an alias for me so that when I type git-tf at the command prompt it runs /opt/git-tf-2.0.1/git-tf. However I'm not sure how he did this. My $PATH variable does not include /opt/git-tf-2.0.1, nor can I find a script by the name git-tf in any of the directories listed in $PATH. The commands whereis git-tf and which git-tf have not been of any help either.

share|improve this question
up vote 2 down vote accepted

Aliases are simply mappings of one command to another. You can list them by typing alias in terminal, and set them by typing alias name=value (e.g., alias rm=rm-i)

Your coworker likely added an alias command to one of the config files that are sourced when your terminal starts. I'd start by looking in ~/.profile, if it exists. Otherwise, you can probably do a search for the alias command in question to find the file.

Other config file locations, as listed by sixtyfootersdude:

  • /etc/profile
  • ~/.bash_profile or ~/.bash_login or ~/.profile
  • ~/.bash_logout
  • ~/.bashrc

For more info on aliases, type man alias.

share|improve this answer
1  
I forgot about alias. Thanks! And thanks for the location of config file locations. I feel like such a newb for even having to ask this question. – Jason Hartley Apr 8 '13 at 23:19

look in your .bash_profile or .profile files. You can try searching for the aliases thus-:

cd $HOME
grep alias *
share|improve this answer
    
.bash_profile is just what I was looking for! Thanks! grep alias * didn't work for me though. :-( – Jason Hartley Apr 8 '13 at 23:18

You have to modify/create a .bashrc file into your home directory, and inside that file you must insert:

PATH=/opt/git-tf-2.0.1/:$PATH

That line will cause you append the desired directory in your current path

after you must exec source .bashrc from a console

Finally try exec:

git-tf
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .