Questions tagged [alias]

Use this tag for questions concerning use of alias in macOS

An alias is one top two different concepts.

  1. A file that represents another object in the file system.

  2. A function of a shell. An alias is text that the shell will replace with text that is defined for each alias For zsh http://zsh.sourceforge.net/Doc/Release/Shell-Grammar.html#index-aliasing

194 questions
138
votes
3 answers

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 them or should I just remove them using unalias and…
MattStacey
  • 1,577
  • 3
  • 11
  • 7
39
votes
2 answers

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

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 When I source my .bashrc file, however, (. .bashrc),…
David Faux
  • 2,025
  • 7
  • 25
  • 22
32
votes
1 answer

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 followed this tutorial to create the bookshelf alias.…
mbigras
  • 1,100
  • 2
  • 10
  • 21
28
votes
2 answers

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 press. Which key to press when dragging in order…
Barth
  • 493
  • 1
  • 6
  • 9
27
votes
2 answers

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/alias is used only in one machine or…
prosseek
  • 5,554
  • 13
  • 48
  • 83
24
votes
2 answers

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 to an invalid path and prompts me to delete the…
Senseful
  • 23,371
  • 78
  • 181
  • 281
22
votes
5 answers

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 one-step, command line action I can use, to…
LessPop_MoreFizz
  • 1,490
  • 4
  • 21
  • 36
21
votes
8 answers

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 shell init scripts also source .bash_aliases or…
Elad Benda
  • 1,520
  • 5
  • 21
  • 27
14
votes
6 answers

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: cd: example-alias: Not a directory. Is it possible…
Steven
  • 341
  • 2
  • 6
13
votes
2 answers

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 for connecting to various remote sessions and I…
nehem
  • 240
  • 1
  • 2
  • 12
10
votes
2 answers

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 there a way in the system where I can make them smaller…
jackJoe
  • 659
  • 1
  • 7
  • 19
8
votes
2 answers

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 terminal, the terminal notes that the alias is not a…
David Faux
  • 2,025
  • 7
  • 25
  • 22
7
votes
1 answer

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='ssh -l [username]…
gernophil
  • 161
  • 5
7
votes
1 answer

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 contains nothing useful, just an empty "PDF Expert" folder and a…
NotationMaster
  • 978
  • 4
  • 13
  • 25
7
votes
2 answers

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 storage, I would like to move some data to the…
j-beda
  • 1,451
  • 10
  • 19
1
2 3
12 13