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 ...


8

Click any file or folder, press and hold down the ⌘ Command + ⌥ Option keys, and then drag the file or folder while continuing to hold down the ⌘ Command + ⌥ Option keys. An alias appears where you release the mouse button.


8

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 ...


7

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 ...


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 ...


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 ...


5

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 ...


5

Try this on Terminal: cd ~/Desktop ln -s ~/Library/path/to/folder


5

You have to press cmd + alt while dragging


5

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 ...


5

Use absolute paths for the jar file: alias dsim='java -jar /path/to/dsim.jar'


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.


4

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); ...


4

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 ...


4

It doesn't work because the cd is executed on your local machine when the ssh does terminate. Here is the way to do it: alias appl="ssh 9@lon.orb.com 'cd /opt/tomcat/instances ; exec ${SHELL} -i'"


3

You must use the Unix ln command from Terminal. ln -s existingname newname


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

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

Try adding the following line to your /etc/hosts file: 10.0.0.1 alias.local


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

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

In the finder : Cmd+I or Right click > Get Info


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

The information is accessible through dscl. To add the alias "visitor" and be able to use this username for guest login, use the following command: sudo dscl . -merge Users/Guest RecordName visitor


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+)* ...



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