To make aliases of macOS Unix commands in your bash or zsh shell on macOS and earlier versions, it is done via your .bash_profile or .zsh file which lives in your home account directory, if the file does not already exist, just create one.
As of macOS 10.6 Catalina, Apple has made the zsh shell the default shell, previously it was the bash shell.
Launch Terminal from the /Application/Utilities folder
Create and remove aliases on Mac. To make it easier to find a file, folder, app, or disk, you can create an alias for it and put the alias in an easy-to-find location. When you open an alias, the original item opens. In Mac OS 8.5 options were added for command-option dragging an object in the Finder to create an alias at that location. This is where the alias cursor was added to the system. The cursor mirrors the appearance of the 'create shortcut' cursor on Windows systems. Programming API. The Alias Manager API is part of Carbon. It is unknown whether it.
Go to your home directory by just entering cd followed by the ‘return’ key to enter the command:
List your home directory contents including invisible files to see if the file already exists, use:
Create the .bash_profile or .zsh file using the command line program called ‘nano’ if it doesn’t exist:
When the .bash_profile or .zsh file is created you are ready to enter your alias commands.
So here I am using the alias ‘l’ to alias the command ‘ls -lah’
So here I am using the alias ‘l’ to alias the command ‘ls -lah’
In nano ‘control+o’ to write the file out and ‘control+x’ to exit the file.
Create Alias Mac Mojave
Refresh the shell environment by entering the command below:
Or..
Create Alias For Mac Mojave
That’s it, now the alias will take effect.
To add other aliases just start a new line, and apply the same formatting.
This content has been archived, and is no longer maintained by Indiana University. Information here may no longer be accurate, and links may no longer be available or reliable.
Alias Mac Os
In Mac OS X, an alias is a pointer file that allows you toquickly open the files, folders, servers, or applications used mostoften. When you double-click an alias, the operating system finds thefile it references and opens it. An alias can be distinguished by itsicon, which has an arrow in the bottom left corner. Normally, an aliaswill remain functional until the original item is deleted, even if theoriginal has been moved or renamed.
Creating an alias
You have several options for creating an alias:
Mac Alias Command
- Drag and drop: Click the item you wish toalias and hold down the mouse button. Then, while holding down the
Command
andOption
keys, drag theitem to where you want the alias to appear. Instead of moving theoriginal item, this will create an alias at the new location. - Contextual menus: Hold down the
Ctrl
key and click the item you wish to alias. From the contextual menu,select Make Alias. The new alias will appear next to theoriginal. - Keystroke: Select the item you wish to alias, andpress
Command-l
(the lowercase L). The new alias willappear next to its original. - File menu: Select the item, and then from theFile menu, select Make Alias. A new alias icon willappear next to the original.
Once you've created an alias, you can move it to a more convenient location, and then rename it or give it a new icon as you wish.