LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problems with commands (https://www.linuxquestions.org/questions/linux-newbie-8/problems-with-commands-87460/)

Hultenius 08-30-2003 07:54 PM

Problems with commands
 
Hi.

Im quite new to linux and have a problem.

I got a dedicated linux-server yesterday and everything worked fine. I ordered an additional IP and typed "netconfig --bootproto none --ip xxx.xxx.xxx.xxx --netmask 255.255.252.0 --device eth0:".

To restart the network i typed "/etc/init.d/network restart" but the network never came back so i had to remotely reset the power to restart the server. Everything started upp fine and the IP worked.

However, the command "netconfig" didn't work anymore. Now i have to type "/usr/sbin/netconfig".

Today, i tried to install RRDtool. I unzipped all files and typed the commands as i was told to:
Quote:

sh configure
make
make install
No errors but the command "rrdtool" didnt work. I had to type "/usr/local/rrdtool-1.0.45/bin/rrdtool".

I also tried to install another program. Same problem, the command didn't work.

Does someone know what is wrong? Can it be solved?

Very pleased for help :)

edit:
and yes, i was logged in as root the whole time.

nastrand 08-30-2003 11:09 PM

Type $PATH into a shell. If you don't see /usr/sbin then add it by typing export PATH=/usr/sbin:$PATH

gizmogadgetus 08-30-2003 11:12 PM

sounds like a problem with your path. Make sure all the directories that contain binaries you want to execute as a single command are in your path in your bash_profile (if you're running bash as your shell). Alternatively, you can create links to the executables in a directory that already exists in your path. If you want to see what's in your path type echo $PATH at the command line for the user your trying to run as.

gizmogadgetus 08-30-2003 11:16 PM

try not to use export command
 
If you use the export command, you will have to do this everytime an action that reads the profile happens (new shells, logging out/in, rebooting machine, etc...) If you don't want the hassle of typing this over and over, edit the shell profile and add it there. There should already be an entry that you can edit.

Hultenius 08-31-2003 06:13 AM

Thank you very much!

When i type $PATH i got this:
Quote:

bash: /usr/lib/courier-imap/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/user/bin: No such file or directory
netconfig worked when i typed "export PATH=/usr/sbin:$PATH". :)

Now my second question, what to do in bash_profile? I tried to open /root/.bash_profile but i dont understand what to edit :confused:
Quote:

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin
BASH_ENV=$HOME/.bashrc
USERNAME="root"

export USERNAME BASH_ENV PATH
Except of "export PATH=/usr/sbin:$PATH", i also want "export PATH=/usr/local/rrdtool-1.0.45/bin:$PATH" to be excuted at start.

Thanks. :)

gizmogadgetus 08-31-2003 10:44 AM

in the section of the profile above change the line that says:
PATH=$PATH:$HOME/bin
to say
PATH=/usr/sbin:/usr/local/rrdtool-1.0.45/bin:$PATH:$HOME/bin
and that should do it

Hultenius 09-02-2003 06:05 AM

once again, thx :)


All times are GMT -5. The time now is 03:42 PM.