How to create Terminal alias in OS X

How to create Terminal alias in OS X

Those of you, who are familiar with Unix/Linux systems and also like to use the Terminal, knows the benefit of an alias for complex recurring commands.

Wikipedia definition:

In computingalias is a command in various command line interpreters (shells) such as Unix shells4DOS/4NT and Windows PowerShell, which enables a replacement of a word by another string. It is mainly used for abbreviating a system command, or for adding default arguments to a regularly used command. Aliasing functionality in theMS-DOS and Microsoft Windows operating systems is provided by the DOSKey command-line utility.

Aliase im Terminal unter OS X erstellen

To create an alias in OS X, you have to create a .bash_profile file in your home directory. To do that you have to use the following command in the Terminal:

vi ~/.bash_profile

Now you can define different alias with the vi (text editor in the bash). For example if you want to you use ll as a shortcut for ls-la (list the current directory in list view and hidden files) type the following alias in the .bash_profile (here you find a tutorial how to use the vi)


0 Antworten

Hinterlassen Sie einen Kommentar

Wollen Sie an der Diskussion teilnehmen?
Feel free to contribute!

Kommentar verfassen