Help - Search - Members - Calendar
Full Version: Accessing programs
The Planet Forums > Operating Systems > Red Hat Linux
Paul
OK, dumb question:
How do you make it so you only type "program" to get it to run, instead of /path/to/program?
This is for my RH 7.2 system.
jaume
If you do it as root just su to root using "su -".
emkay
QUOTE
Originally posted by Paul
OK, dumb question:
How do you make it so you only type "program" to get it to run, instead of /path/to/program?
This is for my RH 7.2 system.


You need to make an alias.

If you want to do this as root user, su to root, then type 'cd' to get to the root directory.

In this directory is a file called .bashrc. Open this file and add any aliases you wish. For example you can add a line:

alias iptables='/sbin/iptables'

Generally you will add:

alias program='/path/to/program'

I also remove the rm='rm -i' alias so that deleting directories containing a lot of files isn't such a hassle. If you do this be *very* careful with the rm command.

mk
elendal
...
janderk
And if you want to run something in the current directory type:

./program

Any program that is in the environment PATH you can run without specifying a path. To check the current path type:

echo $PATH

You can always customize your $PATH if you want to.

JD
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-2010 Invision Power Services, Inc.