Help - Search - Members - Calendar
Full Version: Alias Command
Linuxhelp > Support > Technical Support
ctrunk514
How can I make Alias command:

like if I want to make it so that when a user types "edit" at the command prompt and PICO starts

or

Type some "someword" and it really executes "some Linux command"

I know this is possible, I just can not remember how to do it


Red Hat 9
Joey
There is a few ways to do this.

For the edit command you can use a symlink to pico.

For example:

ln -s /usr/bin/pico /usr/bin/edit

You can also create aliases in your shell's .rc file.

For example, i use TCSH and in my /home/username/.tcshrc I have the following:

alias sd 'lynx http://www.slashdot.org'

So if I type sd it opens up lynx and goes to slashdot.org.

If you run bash there should probably be a .bashrc file in your home dir. The formatting for this file is slightly different. An example for bash would be:

alias sd='lynx http://www.slashdot.org'
ctrunk514
Awsome!!

Thats exactly what I wanted!

you da man
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.