1

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.

3 Answers 3

2

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.

1
  • 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. Apr 8, 2013 at 23:19
0

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

cd $HOME
grep alias *
1
  • .bash_profile is just what I was looking for! Thanks! grep alias * didn't work for me though. :-( Apr 8, 2013 at 23:18
-1

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

You must log in to answer this question.

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