Where should I install an alias file under UNIX bash ?

Login or Register for Dates, Times and to Reply

Thread Tools Search this Thread
Operating Systems OS X (Apple) Where should I install an alias file under UNIX bash ?
# 1  
Where should I install an alias file under UNIX bash ?

I have a file named 'aliases' which contains a list of aliases like:

alias loc='locate'
alias h='history'
alias .='pwd'
alias ..='cd ..'
alias cd..='cd .. ; pwd'


Where should I put this file (alias) so when Terminal launches .bash and thus a shell at opening , this file could automatically be launched with it ?
There is a file named .bash under some directory which I hesitate to modify because it is read-only. Smilie
I just need to execute automatically the UNIX command sh aliases at every window opening under Terminal.

I own a PowerBook Mac with OS Lion 10.7.2
# 2  
I usually put aliases in $HOME/.alias, and . (or source) it from $HOME/.bashrc (or .profile. or .cshrc, etc).
This User Gave Thanks to CarloM For This Post:
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #847
Difficulty: Medium
Proximity marketing is the localized wireless distribution of advertising content associated with a particular place.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Alias does not work with bash profile

Hi, Below is what i have in my profile: alias wldm='cd /opt/app/wls' If i use bash or ksh shell this alias does not work. What should be done for this alias to work with all these simultaneously -> No Shell, bash shell, and ksh shell (14 Replies)
Discussion started by: mohtashims
14 Replies

2. Shell Programming and Scripting

Creating .../ alias in bash

I want to create an alias as follows but is not working alias ../='cd ../' (3 Replies)
Discussion started by: kristinu
3 Replies

3. Shell Programming and Scripting

Not able to create alias in bash Sun solaris

Hello Friends, I am facing problem in creating aliases. I am working in SunOS 5.10. When I login in system i have been given ksh shell. What i am doing is that ? I am changing shell to bash then I am creating 2 alias in command prompt like: alias deploy_dir=' cd... (4 Replies)
Discussion started by: krsnadasa
4 Replies

4. Shell Programming and Scripting

Suppressing carriage return in bash alias

I'd like to create an alias that displays my string but leaves my cursor at the end. Not seeing any examples of this. One indirect way might be to preload or stuff the history buffer, so I just hit up arrow. (2 Replies)
Discussion started by: tns1
2 Replies

5. Shell Programming and Scripting

how can I export an alias and use it in any shell that I want to switch to like bash, ksh

None of the aliases that I set are available if I switch to a different shell. How can I export aliases and make them available in any shell that I switch to like ksh or bash ? I tried these $>alias godata='cd /home/kc/app/data' $>alias -x godata='cd /home/kc/app/data' $>alias |... (2 Replies)
Discussion started by: kchinnam
2 Replies

6. UNIX for Dummies Questions & Answers

BASH: Change alias to script to add a task

Hi. I use an alias, "homeperm" as shorthand for curl -o. Since most of what I download via cUrl is graphic image files -- jpeg files -- I'd like to be able to change this alias to a script, or use it to invoke a function, which will not only download the file but date-stamp it using Exiv2 in... (4 Replies)
Discussion started by: SilversleevesX
4 Replies

7. Shell Programming and Scripting

Bash alias for complicated ls command does not work.

I'm trying to set up an alias in .bash_aliases to show just the filenames of the files in a directory, which the following command will do: ls -l | grep ^- | awk '{print $NF}' kjb.zip ap.zip tor.zip However when I set up the following alias in .bash_aliases: alias lf="ls -l | grep ^- |... (16 Replies)
Discussion started by: gencon
16 Replies

8. UNIX for Dummies Questions & Answers

alias in bash shell for CTRL + l

Is it possible to create an alias wherein it will use a keystroke. Like to clear the screen in bash i have to use CTRL + l. I want to make an alias 'c' out of this. Thanks. (6 Replies)
Discussion started by: or_knob
6 Replies

9. Shell Programming and Scripting

bash alias help

I try the following alias: alias psx='ps auxw | grep $1 | grep -v grep' but it fails with "grep: yyy: No such file or directory" (for 'psx yyy' command). the following is ok: alias psx='ps auxw | grep $1' why this happens? how to overcome this? thanks (3 Replies)
Discussion started by: ynir
3 Replies

10. UNIX for Dummies Questions & Answers

Query regarding alias and setting bash as a default script

Hi All, I am setting bash as my working shell in my .profile file. So I have written a line : bash as the list line in my .profile I want to use alias as follows: alias me='who am i' When i log in, as expeced I enter the bash shell but alias doesn't work. Is it because the alias is defined... (1 Reply)
Discussion started by: VENC22
1 Replies

Featured Tech Videos