
This will include ~/.bashrc for login shells and in the order you wish if one file depends upon the other based on what you are setting. These lines should be in the file ~/.bash_profile: if then

If the rc file is primary, source that at the beginning of your profile Also, decide which of these should be "primary" and if the profile is your choice, tack on the rc file at the end. You should put most of your customizations (including aliases) in ~/.bashrc and have ~/.bash_profile run ~/.bashrc, so they apply to both login (~/.bash_profile) and non-login (~/.bashrc) shells.

~/.bashrc gets run for both login and non-login shells, ~/.bash_profile only gets run for login shells. Unless you find where it is defined and loaded, it will be loaded again when you start a new Terminal session. Unalias will only work for your current session.

Include the following in ~/.bash_profile or create a new file ~/.All you need to do is type alias at the prompt and any active aliases will be listed.Īliases are usually loaded at initialization of your shell so look in. #define CHECK(rc,check_value) if ((check_value) != noErr) exit((rc))įSResolveAliasFile( &fsRef, TRUE, &targetIsFolder, &wasAliased)) įSRefMakePath( &fsRef, targetPath, MAX_PATH_SIZE)) Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, License along with this program if not, write to the Free You should have received a copy of the GNU General Public General Public License for more details. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. WITHOUT ANY WARRANTY without even the implied warranty of This program is distributed in the hope that it will be useful, but License, or (at your option) any later version. You can use this folder of aliases trick to create quick-launch panels in the Mac Dock, just drag that folder of aliases into the right hand side of the Dock and it will become an easily accessible launch panel of whatever aliases are stored within that folder. published by the Free Software Foundation either version 2 of the modify it under the terms of the GNU General Public License as This program is free software you can redistribute it and/or warning: pointer targets in passing argument 1 of 'FSPathMakeRef' Note: gcc version 4 reports the following warning gcc-3.3 -o getTrueName -framework Carbon getTrueName.c was an alias, or 1 if the argument given was not an alias The error number returned is 255 on error, 0 if the file name of the "Original" or actual file. Resolve HFS and HFS+ aliased files (and soft links), and return the

You can add it to your PATH, or just copy it directly to /usr/bin or /usr/local/bin so it’s easy to access.Ĭ source code for getTrueName (copy the text and save the file as getTrueName.c in your home directory): // getTrueName.c This will create the ‘getTrueName’ executable in the same directory as the source. To enable cd'ing into a folder alias I've found the following at Mac OS X Hints.Ĭompile the source code below with the following command: gcc -o getTrueName -framework Carbon getTrueName.c
