Questions tagged [alias]

Use this tag for questions concerning use of alias in macOS

Filter by
Sorted by
Tagged with
107
votes
2answers
184k 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 ...
28
votes
2answers
102k 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 davidfaux@davidfaux.com' However, when I open terminal and run myserver, terminal complains that -bash: myserver: command not found ...
25
votes
2answers
13k 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/...
24
votes
2answers
64k 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 ...
24
votes
1answer
10k 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 ...
22
votes
2answers
25k 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 ...
18
votes
7answers
45k 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 ...
17
votes
5answers
38k 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 ...
10
votes
6answers
5k 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: ...
10
votes
2answers
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 ...
8
votes
2answers
326 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 ...
7
votes
4answers
11k 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, ...
6
votes
4answers
6k 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 ...
6
votes
3answers
7k 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?
6
votes
1answer
1k 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. ...
6
votes
1answer
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 ...
6
votes
1answer
2k 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 ...
5
votes
2answers
3k 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 ...
5
votes
2answers
2k 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 ...
5
votes
1answer
2k 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 ...
5
votes
1answer
171 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 ...
5
votes
4answers
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 ...
5
votes
1answer
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 ...
5
votes
3answers
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 ...
5
votes
1answer
589 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 ...
5
votes
1answer
284 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 ...
4
votes
2answers
15k 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 ...
4
votes
2answers
1k 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-...
4
votes
5answers
4k 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 ...
4
votes
2answers
1k 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?
4
votes
1answer
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'.
4
votes
2answers
150 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 ...
4
votes
2answers
47k 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 ...
4
votes
1answer
4k 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 ...
4
votes
3answers
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 ...
4
votes
2answers
815 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 ...
4
votes
2answers
12k 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 ...
4
votes
2answers
336 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 ~/...
3
votes
3answers
256 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 ...
3
votes
2answers
1k 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 ...
3
votes
3answers
3k views

How to create a shortcut on the desktop to a selected folder

In windows when right clicking a folder there is an option: send to -> desktop (create shortcut). How can I do this on a Mac?
3
votes
1answer
794 views

Alias in bash to Change Directory

When I am typing in a typical alias with my .bash_profile, my change directory is not working. I currently have the following: alias cdicloud="/Users/<username>/Library/Mobile Documents/com~...
3
votes
1answer
794 views

Adding a username alias using the command line

How do I add a username alias using the command line? I can do it fine using the preferences dialog through the "Advanced Options", but I need to do it during an installation script. Can someone ...
3
votes
1answer
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 administrator@bromine.org' I then sourced my ....
3
votes
1answer
5k 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 ...
3
votes
2answers
550 views

Trying to get a Symlink but it turns to be an Alias

I'm trying to move my Backup folder from the SSD to another internal HD via symlink using this command: ln -s /MacintoshHD/Backup ~/Library/"Application Support"/MobileSync the problem is, when i ...
3
votes
4answers
3k views

How do I replace an alias by the original file it is linking to?

I have a folder containing several alias for pdf's that each have > 200 mb. Each pdf is in a different location on my drive. I need to compress all of those files. What is the fastest way to do it? ...
3
votes
2answers
9k views

How to make an alias link to a Windows server folder

On our server (windows 2012) we have a folder for Scan files called server/scans/(username). I know how to setup link from windows PC so that user can access the scans. How do I setup the same thing ...
3
votes
1answer
1k views

Apple alias in Mail and iCloud revealing my identity

I've set up a few email aliases in iCloud under pseudonyms. If I receive an email to one of them (e.g. "Alias Name <pseudonym@icloud.com>), and I try to reply in Mail for Mac, it uses the ...
2
votes
2answers
5k views

How do I create a shortcut link from the dock to an application?

I'm trying to put a link to Outlook Express in my dock but can't see how it's done. When I right-click on the application icon in a finder window, "Make Alias" is not one of the options available, so ...