Tag Info

Hot answers tagged

16

The quote marks are preventing ~ from being expanded to your home folder, so you need to either quote just the part with the space in it: ln -s ~/"Foo Bar/" Foo Note: exactly how much is quoted doesn't matter, as long as the space is in the quoted portion and the ~ isn't. ~/Foo" "Bar/, ~"/Foo Bar/", ~/Fo"o B"ar/ etc are all equivalent. You could also use ...


11

An alias contains two pieces of information: a unique identifier of the file it links to, and the path and file name of the file it links to. If you rename or move a file, and then create a new file with the path and file name that the file originally had, then any alias that linked to the original file now links to the new file. However, if you rename or ...


10

All you need to do is type alias at the prompt and any active aliases will be listed. Aliases are usually loaded at initialization of your shell so look in .bash_profile or .bashrc in your home directory. unalias will only work for your current session. Unless you find where it is defined and loaded, it will be loaded again when you start a new Terminal ...


7

mkalias is a binary available in a set of tools here. This is a SH shell script that calls AppleScript to create an alias. I'm including the shell script here for future reference incase it goes missing from the nets. #!/bin/sh # make_alias # This script takes two command-line arguments: # 1) The name (relative or full path) of a source file or folder ...


7

You can create soft links (a.k.a. symbolic links or symlinks) from the terminal, the same way as in any other Unix system. I'm not familiar with Dropbox so I'll make up an example assuming that there is a folder Dropbox in your home directory: cd ~ ln -s ~/Dropbox/aFolder Desktop/aFolder Note that ln takes the link to create as its second argument; think ...


5

In short you are putting your aliases in the wrong file .bashrc, that is why you need to keep running source to get the aliases working in any new login terminal instances. By default, Terminal starts the shell via /usr/bin/login, which makes the shell a login shell. On every platform (not just Mac OS X) bash does not use .bashrc for login shells ...


5

No - aliases are a combination of a sym link pointing to a place as well as a unique file ID to track that file if it moves so the alias won't be broken if the file still resides on the original volume. (the file ID changes across volumes and an alias will only remain valid if the relative path is correct if and when the file ID half is broken by a ...


4

You can't pass arguments to aliases. Aliases are just text substitutions without further logic. But you can use shell functions to achieve the same result: function pman() { if [ -x /usr/bin/open ]; then man -t "$1" | open -f -a Preview else man "$1" fi } The if-then-else part is there just to make sure it also works on ...


4

For any app you want to add to your dock as a shortcut, the process is as follows: Launch the application. The application's icon will appear in the dock. Right click the application's icon in the dock. Go to "Options". Select "Keep in Dock". Now the application's icon will remain in the dock as a shortcut when you quit the application.


3

Since Lion, in addition to storing Retina icons, it seems that an alias stores its many different sizes of icons in both the data and the resource fork (the xattr com.apple.ResourceFork). Possibly in a move away from Resource forks, while still supporting previous OSes (for now). The alias I just created contained the follow formats: is32, s8mk, ic11, il32, ...


3

It seems like your bash shell is looking for .profile instead of .bashrc . What you can do is make a symbolic link: ln -s ~/.bashrc ~/.profile and restart your session (close, reopen Terminal). Any future bash setting updates can be made to .profile or .bashrc.


3

Symlinks are a Unix concept. They are special files that point to other files, so that, in many cases, accessing the symlink (for instance if it points to a shell script) really access the underlying file (running the script). Aliases are a Mac concept (though OS/2 had something similar, I forget what it was called). As far as I can tell aliases can be ...


3

You can create aliases directly to network shares the normal way, by right-clicking the mounted share and choosing "Create Alias." If you want to create an alias/bookmark to the server so you can select which share to mount every time, do the following: Open Safari Bookmark any page to make a new bookmark Edit the bookmark to point to your server and ...


3

Aliases are not the same as symlinks. Symlinks just point to a path (relative or absolute). Aliases first track the file's unique ID and then the path. Since there are two pieces of information stored in an alias - they are more robust and will follow a file that's moved based on the unique ID. Finder (or the very powerful ditto) are your best bets for ...


3

Alternatively, you can simply drag the folder to the desktop while holding the optioncommand keys… If your windows are so cluttered that it is inconvenient, just make sure your Desktop icon is showing in the "Places" location on the Finder sidebar, and drag the item while holding optioncommand to that icon.


3

Start automator Make new service Set it to receive files and folders in finder add the 'new aliases' command it's set to desktop by default save the service as 'send alias to desktop' and voila! Now you have an extra option under the right click menu, and a service in the finder menu!


3

The default ls provided with OSX comes from BSD and won't allow you to do what you want. Using CoreUtils ls (installed with macport it's available with the gls command) You'll get your colors using --color=always: ls -l --color=always | awk ' { k=0; for (i=0;i<=8;i++) k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i)); if (k) printf("%0o ",k); ...


2

Here's my stab at solving this problem with Applescript. The following applescript will take selected aliases in the Finder and try and relink them to the new path replacing Backup with External in the POSIX path. Hopefully it's straightforward. You could probably make it recursive to search for aliases in selected folders, but that's more work than I care ...


2

TextMate can use either the file extension or the first line of a file to divine what filetype it is. For my diff bundle (I think it's the original), this is: firstLineMatch = '(?x)^ (===\ modified\ file |==== \s* // .+ \s - \s .+ \s+ ==== |Index:\ |---\ [^%] |\*\*\*.*\d{4}\s*$ |\d+(,\d+)* (a|d|c) \d+(,\d+)* ...


2

You should have a look in /etc/profile or ~/.profile or ~/.bash_profile or ~/.bashrc Which are plausible startup files for your shell (that I assumed is bash).


2

I'm not sure I understand your question. The -bash: prefix you see is simply bash's way of identifying itself as the source of the error message. In this case you entered cdp which is neither an external nor internal shell command nor was it defined as an alias or function. While in a (bash) terminal, you can simply type exit to leave the terminal and ...


2

I am unable to replicate this behaviour – when I click "Reply" in the native OS X Mail app, having All Inboxes selected, the address and correct alias name pops up. (If I only have the iCloud-inbox selected, it automatically replies from the main iCloud address..) One thing you should do is double check the alias' settings on iCloud.com – specifically the ...


2

If you need this machine wide you need to look in the /etc folder. However, they may not exist by default, in which case you simply need to create them in the above folder and restart terminal. You will most likely need to use sudo to create them as the /etc folder is owned by root. If you need this for every terminal you open you don't need to do it ...


2

If you use bash, add the alias commands to ~/.bashrc and save a file like this as ~/.bash_profile: . ~/.bashrc When bash is invoked as an interactive non-login shell, it reads .bashrc but not .bash_profile. When bash is it is invoked as an interactive login shell, it reads .bash_profile but not .bashrc. Terminal and iTerm open new shells as login shells ...


2

Let's try a few experiments and look at a few things. In the Terminal go to your home directory and create a directory. cd ~ mkdir test cd test Now create a file we can be sure about echo "We all loved Steve" > file.txt ls -l@ Try a hard link :- /usr/bin/ln file.txt hard.txt Then try a symbolic link :- /usr/bin/ln -s file.txt symbolic.txt ...


1

File Buddy might solve your problem. According to their website, it can: Find empty files and folders, orphaned files, duplicate files, broken aliases, and unused preference files. The user interface is a little weird, but it does have the functionality to scan either the entire drive or a particular folder, so I think it'll meet your needs. It costs ...


1

sudo and open provide all the functionality already for editing files of other users so you can just run SUDO_EDITOR="open -FWne" sudo -e /etc/hosts to edit /etc/hosts. Make sure to quit Textedit at the end (Cmd-Q) because otherwise sudo won't notice that you're done with editing. To make life easier add the following to your .bashrc (or .alias if you ...


1

It's possible to do it in one line of Terminal. Let's say you want to alias to the file "/Users/me/Library/Preferences/org.herf.Flux.plist". osascript -e 'tell application "Finder"' -e 'make new alias to file (posix file "/Users/me/Library/Preferences/org.herf.Flux.plist") at desktop' -e 'end tell' You should replace to file with to folder if you have a ...


1

1) The easy answer is that aliases are symbolic links, but ONLY for the Finder. Other applications don't generally use them as such, whereas symlinks act as aliases for the Finder as well but also act as symlinks for any Application. Aliases are actually MUCH better than symlinks for Finder-type uses as then don't break, and you can do things like, for ...



Only top voted, non community-wiki answers of a minimum length are eligible