Click to See Complete Forum and Search --> : command not found...
MrPatel
09-04-2001, 07:23 PM
I installed Midnight Commander (MC) all from the console, cause i messed up a setting in the x windows config file. So i installed MC and it installed properly, in /usr/local/bin
Well, i went there as root, installed it as root, and when i try to run it from /usr/local/bin, it says
bash: mc: command not found
i did ls, and it showed it was there. So i logged on as one of the regular accounts, and it worked fine. What could be my problem?
Craig McPherson
09-04-2001, 08:40 PM
/usr/local/bin/mc
If you're in /usr/local/bin:
./mc
If /usr/local/bin is in your PATH:
mc
The problem is basically the fact that the root PATH variable usually differs from that of a regular user. If you login as root, you'll find your PATH set to something like
/bin:/sbin:/usr/bin:/usr/sbin
..which basically gives the super-user the PATH where all the administrative apps are housed, and a regular user might have
/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/usr/games
...again, giving the regular user the 'normal' applications directories that they might expect to run. While it's not recommended to actually login as root (rather use 'su' or 'sudo') you can either add the path to your PATH variable, or just key it in by hand each time you want to run it, as Craig suggested: /usr/local/bin/mc.
To actually add something to your PATH, issue the command (or add it to your .profile)
PATH="$PATH:/usr/local/bin"
..or whatever directory you want to add.
Luck!
[ 04 September 2001: Message edited by: bdl ]