PDA

View Full Version : Command line aliases in linux


Ridemonkey
09-08-2003, 06:29 PM
Which file is it that I put command line aliases in so that I can name my own commands?

So like I would type xxx and it would do a rm -rf * or something like that.

splat
09-08-2003, 07:16 PM
What Shell are you using ?

Ridemonkey
09-08-2003, 07:18 PM
I dunno. I'm using Red Hat Linux 9 and I have a $ at the prompt. Was that enormously unhelpful?

CrAckErKorEan
09-08-2003, 09:26 PM
Sounds like BASH to me.
Try this itl tell you what shell your using.

cat /etc/passwd | grep (username) that should tell you

Mine says

crackmunch:x:503:503:crackmunch:/home/crackmunch:/bin/bash

and for the alias

alias "whatyouwant=commandtoexecute"

That should work.

Transcend
09-08-2003, 11:28 PM
Originally posted by Ridemonkey
I dunno. I'm using Red Hat Linux 9 and I have a $ at the prompt. Was that enormously unhelpful?

It's bash then.

splat
09-09-2003, 06:07 PM
and to have them load each time you log in put them in the

.bashrc file

Ridemonkey
09-11-2003, 10:28 AM
Cool, I'll try that.