Questions tagged [alias]

Use this tag for questions concerning use of alias in macOS

Filter by
Sorted by
Tagged with
141 votes
3 answers
279k views

How can I list and edit all defined aliases in Terminal?

A friend who owned my current Mac before me created a lot of alias commands. Is there a way to list all defined aliases and the command that is associated with them? And if so, am I able to edit ...
MattStacey's user avatar
  • 1,607
39 votes
2 answers
165k views

Why must I source .bashrc every time I open terminal for aliases to work? [duplicate]

I added this line into my ~/.bashrc file. alias myserver='ssh [email protected]' However, when I open terminal and run myserver, terminal complains that -bash: myserver: command not found ...
David Faux's user avatar
  • 2,035
32 votes
1 answer
17k views

Can't cd into alias

I have two aliases in my home directory: devbootcamp and bookshelf. I can cd into devbootcamp but not bookshelf but I'm not sure why. I don't remember how I made the alias to devbootcamp but I ...
mbigras's user avatar
  • 1,200
28 votes
2 answers
29k views

How to create an alias with drag and drop?

In MacOSX, when dragging a file or folder one can force a copy instead of a move by pressing option. I think that there used to be a way to alternatively create an alias but can't find which key to ...
Barth's user avatar
  • 503
28 votes
2 answers
16k views

What's the difference between alias and link?

I see that the size of alias is 167.7kB, whereas symbolic link is just 4kB. What's the difference between the two, or what's the purpose of them? Which one is preferable? For the case that the link/...
prosseek's user avatar
  • 5,694
24 votes
2 answers
70k views

How do I create a symbolic link to a directory with a space in it?

I was trying to create a symbolic link using the following command: ln -s "~/Foo Bar/" Foo ... but it didn't work (i.e. when I go into finder and try double clicking it, it says that it's pointing ...
Senseful's user avatar
  • 23.9k
24 votes
5 answers
46k views

Can I create a Desktop Shortcut/Alias to a Folder from the Terminal?

I'd like to create a desktop shortcut to a specific folder, buried deep within ~/Library/. Library is Hidden by default in Lion, and I'd like to keep it that way, for a variety of reasons. Is there a ...
LessPop_MoreFizz's user avatar
21 votes
8 answers
56k views

How to persistently define aliases in Terminal

I want to add aliases to my environment so that they are available in all Terminal instances. I got this answer: Yes, you can put it in your .bashrc, .bash_profile or .profile. On some systems the ...
Elad Benda's user avatar
  • 1,602
14 votes
2 answers
35k views

Creating aliases for iTerm 2 that work during ssh

I use numerous aliases set at a given UNIX environment. For example my current fish shell under OSX have these below gm -> git merge dk -> docker kill and so on. Now the challenge is I use iTerm 2 ...
nehem's user avatar
  • 250
14 votes
6 answers
8k views

How to go to alias from terminal?

By alias, I mean the folder shortcut created when you right-click a folder in Finder and select "Make Alias". I can traverse symbolic links in Terminal with cd, but it doesn't work on aliases: bash: ...
Steven's user avatar
  • 391
10 votes
2 answers
2k views

Why are the alias so big in filesize in Mountain Lion?

I noticed the alias(es) that I create in Mountain Lion are very big in filesize (for example an alias to a folder is 5.8MB!) Compared to Leopard, they were just about 500KB. Why is this? and is ...
jackJoe's user avatar
  • 658
8 votes
2 answers
335 views

How can I make a soft link in Lion?

I realized today that an alias is not the same thing as a soft link in Lion. I made an alias of a folder in my Dropbox folder and moved the alias to my Desktop. When I try to cd into this alias in ...
David Faux's user avatar
  • 2,035
8 votes
1 answer
10k views

What is the "On My Mac" folder in macOS Big Sur?

I have recently upgraded to macOS Big Sur 11.0.1 from macOS 10.15.7 on my 2016 MacBook Pro. In Finder, there is a new (?) folder called "On My Mac" which I have never seen before. It ...
NotationMaster's user avatar
7 votes
3 answers
484 views

Link command in terminal vs ln vs symbolic link (ln -s) differences between them?

I've learnt about aliases and symbolic links ages ago, but only recently learnt of the link command from symbolic link vs. alias Is the link command in terminal on my MacOS - version is Sonoma 14.4.1 ...
avenas8808's user avatar
7 votes
3 answers
12k views

Run lolcat after each command?

I'm trying to add an alias for lolcat that will invoke after each command put into the terminal. I only know how to add it to select items, anyone know how to just make it a standard output?
SNYDERHAUS's user avatar
7 votes
1 answer
1k views

difference ZSH and BASH for $RANDOM?

I just switched from Ubuntu to macOS (due to work reasons). And I wanted to transfer my bash aliases to zsh, but they are not working completely. alias HPC1='ssh -l [username] [server1]' alias HPC2='...
gernophil's user avatar
  • 349
7 votes
2 answers
11k views

Limitations of iCloud+ own domain

What are the limitations of iCloud+ own domain in regard to emails? Use Custom Email Domain with iCloud Mail https://support.apple.com/en-us/HT212514 I am looking for: a single domain which I ...
lzap's user avatar
  • 297
7 votes
4 answers
14k views

How do I fix failed aliases?

I had two external hard disks: External and Backup. External had many aliases which pointed to other files on the same disk. Backup was used to backup External. External failed, and I now use Backup, ...
mouviciel's user avatar
  • 1,479
7 votes
2 answers
8k views

Best practices to move macOS Mail.app storage to an external drive?

I have a system with fairly small internal storage (500GB) so I have attached a reasonably quick external storage device (256GB) that will be constantly mounted. To free up space on the internal ...
j-beda's user avatar
  • 1,455
6 votes
4 answers
9k views

OS X won't create any symbolic links, creates aliases instead

No matter how I try to create an symbolic link OS X refuses to play along and instead creates an alias. I've tried several tools and also through the terminal using the ln command. I am on a fresh ...
user68523's user avatar
6 votes
1 answer
2k views

How to find all the aliases within a given file system?

I would like to avoid any future problems with aliases (empty files created with the Finder, not to be confused with symbolic links) I might have used in the past and which may stay within the system. ...
dan's user avatar
  • 12.2k
6 votes
1 answer
673 views

How can I create a Finder alias in a bash script that reads arguments from the command-line?

I'd like to write a bash script that takes 2 inputs: path to actual file path of a Finder alias file (not a unix link) to be created that refers to 1. The bash script should pass these inputs to an ...
foundart's user avatar
  • 163
6 votes
1 answer
3k views

Adding SMB share to sidebar in OSX Mountain Lion

Is there a way to add an SMB share to the sidebar in Finder, such that when I click on the alias, it mounts the share and opens it up like a regular folder? You can do this in Linux and Windows, and ...
surj's user avatar
  • 213
6 votes
1 answer
2k views

Can an alias be added to the dock via the command line?

I found this article but it handles the GUI solution. I would like to automate the setup of a new machine, and do that I've created Dropbox shares of a number of my common configurations. (I could ...
New Alexandria's user avatar
5 votes
2 answers
12k views

symbolic link vs. alias

Disclaimer: I work with programmers, but am not one myself and have no real / formal knowledge of how an OS works; please be patient if the following makes plain my ignorance :) I am trying to ...
Rax Adaam's user avatar
  • 259
5 votes
2 answers
3k views

How to move a folder containing aliases to another machine without breaking the aliases?

I've got a large folder of music with lots of aliases to tunes that are spread throughout subfolders of the main tunes folder. For example I might keep the original files sorted by artist, and then ...
mash's user avatar
  • 153
5 votes
3 answers
2k views

Alias for network drive

In the Finder > Connect To Server window I have an IP address I connect to. Is there a way to make a nickname or alias for this server?
user avatar
5 votes
1 answer
2k views

How to make an alias (Cmd-L) using command line?

With Finder, Cmd-L is a short-cut to make an alias of a file/directory. How can I use the command line to do that? I tried 'ln -s', but it generates the 'Symbolic Link', not 'Alias'.
prosseek's user avatar
  • 5,694
5 votes
1 answer
3k views

Using 'alias' in bash script in OSX

I write some scripting and I want to make it work on Linux and Mac. The problem is, that "Implementations of sed, readlink, zcat, etc. are different on OS X and Linux." So I tried THIS approach, but ...
Hristo Trendafilov's user avatar
5 votes
2 answers
1k views

Created a symlink but Finder shows it as an Alias

When I try to backup my iPhone, iTunes gives me an error, saying that it cannot make a Backup because the backup is damaged or not compatible. To move the backup folder I have followed the steps as ...
Angelo Noviello's user avatar
5 votes
3 answers
1k views

AppleScript to show package contents of hidden original of alias

I'm attempting to build an Automator workflow (which will be saved as a Service, so that I can both access it from contextual menus and invoke it with a keyboard shortcut), that will function much ...
Parker's user avatar
  • 127
5 votes
4 answers
4k views

Sierra Finder aliases appearing as generic icons

Since updating to macOS Sierra, many Finder aliases appear as generic document icons rather than as the informative icons that were available in previous versions of OS X. Is there something I can do ...
orome's user avatar
  • 11.8k
5 votes
3 answers
5k views

Find a specific file with automator

The basic question is: How can I pass a filename to the Spotlight search module in Automator? The essential problem: I have hundreds of broken aliases scattered throughout a particular directory ...
JVC's user avatar
  • 2,821
5 votes
2 answers
776 views

Difficulty setting the 'Open with app' to an alias

I am trying to set MacVim, installed via homebrew, to be the default HEX file editor. I started this task by creating an alias to MacVim.app located in /usr/local/Cellar/macvim/7.3-61 and placing the ...
Adam Lewis's user avatar
5 votes
1 answer
380 views

AppleScript: alias reference is not changing after renaming a folder

I'm new to AppleScript and after doing: set folder_name to "New_Folder" tell application "Finder" to make new folder at desktop set my_folder to result as alias tell application "Finder" to set the ...
flizamar's user avatar
5 votes
1 answer
3k views

Is it possible to edit a macOS alias with vim?

I like to use macOS's alias feature to not have to make redundant files. These aliases work great with Chrome and TextEdit. When I open them with vim, however, I get a giant messy file (presumably the ...
jack gallerdude galler's user avatar
4 votes
2 answers
17k views

How do I use arguments together with bash aliases

Today, I learned the very handy trick: man [some command] -t | open -f -a Preview I'd like to create an alias in my .bash_profile file as a shortcut. In order for this to work, I need to pass an ...
Adam Rice's user avatar
  • 1,116
4 votes
3 answers
395 views

Alias - 'Show Original' in new tab

Update: After the two answers so far I have moved the goalposts slightly. I need multiple selections & tabs - the existing answers; one has multi-select capability, the other gives me tabs, which ...
Tetsujin's user avatar
  • 116k
4 votes
2 answers
3k views

How to use AppleScript in a bash script to create an alias for an app?

I need to create an alias on my Desktop to an app in my Applications folder, using a bash script file. As far as I know, it's only possible with AppleScript. Unfortunately, my AppleScript skills are ...
0lesya's user avatar
  • 455
4 votes
2 answers
3k views

How to create an Alias with a Variable inside?

I want to create an Alias for my Terminal to quick-search inside files. In Ubuntu is was: alias gre="egrep -rnw ". I used it like that $ gre 'my search string'. Now I want this for my local MacBook-...
MonTea's user avatar
  • 203
4 votes
5 answers
6k views

Make shortcuts to directories via terminal

My problem is: whenever I'm coding, I work inside folders that are inside other folders and it's a long way to type: cd /folder1/folder2/.../folderN I know it's possible to make a shortcut to the ...
Thi G.'s user avatar
  • 2,284
4 votes
2 answers
2k views

List all aliases starting with a particular string

To improve on the steps I have to take to complete some actions on my Mac, I have created many aliases. Example: To open System Preferences, which I have to do often to manage multiple monitors, I ...
displayName's user avatar
  • 2,625
4 votes
1 answer
7k views

How to edit Symbolic Links in OS X?

I had painstakingly gone through and created symlnks to a whole host of files in my system. I couldn't use aliases because they were failing to be copied with RSync, and also certain apps I use to ...
JVC's user avatar
  • 2,821
4 votes
1 answer
3k views

Why don't my aliases in .bashrc work?

I have Lion on my Mac Air. I wrote some aliases in ~/.bashrc file, which looks like: # Aliases alias p='pdflatex *.tex;open *.pdf' alias bromine='ssh [email protected]' I then sourced my ....
David Faux's user avatar
  • 2,035
4 votes
2 answers
55k views

How can I exit "bash"?

I don't know how to get my .profile aliases back in to the terminal every time I try them, this error massage comes up: apaw:~ apaw$ cdp -bash: cdp: command not found How do i exit this -bash? I ...
antpaw's user avatar
  • 193
4 votes
1 answer
8k views

How do I change the icon of an alias to a custom ICO file?

I've created a couple of aliases to Wine executables that I put in my dock, but by default they're all coming up with the standard page icon. I would like to customize these icons using custom ICO ...
soapergem's user avatar
  • 495
4 votes
1 answer
3k views

Alias of app not showing up in launchpad

I downloaded this application (code composer studio from TI) and installed it and two applications showed up inside a folder called "TI (other)", one application called eclipse and another called "...
user8363's user avatar
  • 305
4 votes
2 answers
551 views

terminal custom commands source every time

After following this comment I added all my startup/alias commands to ~/.bashrc file and in ~/.bash_profile I added source ~/.bashrc But still my aliases are not working. I have to manually source ~/...
Niraj Chauhan's user avatar
4 votes
2 answers
2k views

Limit number for "Hide my Email"?

I am in the process of modifying all my accounts to assign a unique email address to each one via the "Hide my Email" function. I am currently at 273 addresses created for the occasion but I ...
JuCos's user avatar
  • 41
3 votes
2 answers
1k views

How do I make aliases hidden in macOS?

When I enter in Terminal: chflags hidden location_of_alias it hides the actual original folder the alias points to but it does not actually hide the alias itself. How do I do it?
J.B.'s user avatar
  • 43