Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tylerc083

macrumors newbie
Original poster
Mar 27, 2005
12
0
i'm trying to create a few aliases in a .cshrc file. I did this on a mac i had a few years ago, but have forgotten how to do it.

I've scoured the net, and everything just says 'open your .cshrc file in your home directory and then...'

that is my trouble i am thinking. i've opened the terminal app, which by default puts me in my home directory, right? there isn't a .cshrc file, so i used pico to create one. i put in a line like this:
alias dir ls -al

i saves and closed pico. closed the terminal app, and reopened, yet dir is unrecognized.

any ideas as to what i am doing wrong?

thanks!
tyler
 
.cshrc is only read if your default shell is csh or tcsh. If you're using a recent version of Mac OS X, then your default shell is most likely bash which does not read .cshrc upon login. To add aliases to bash, edit .profile in your home directory or edit /etc/profile to add the dir alias to all users and add:
Code:
alias dir='ls -la'

bash uses a different syntax to define aliases than csh. Read the man pages on bash ('man bash' from Terminal) for more info on aliases.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.