LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-14-2008, 06:22 PM   #1
LinuxUser101
Member
 
Registered: Feb 2008
Location: Earth
Distribution: RHEL
Posts: 32

Rep: Reputation: 15
Terminal question


If I open a terminal and type ifconfig I get this: bash: ifconfig: command not found

If I type /sbin/ifconfig I get my network information.

For most commands I have to type whereis to locate the correct way to launch the program. Any ideas as to why? Maybe I stoped a service? Please help.
 
Old 04-14-2008, 06:33 PM   #2
kmack1023
LQ Newbie
 
Registered: Apr 2005
Location: Detroit, MI
Distribution: Ubuntu (home), SLES (work)
Posts: 27

Rep: Reputation: 15
I'm no expert, but perhaps you overwrote your path variable? try

Code:
echo $PATH
and see if that helps?
 
Old 04-14-2008, 06:40 PM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,877

Rep: Reputation: 350Reputation: 350Reputation: 350Reputation: 350
/sbin is normally not in the users path. /sbin contains system administrative utilities and are usually used by the root user.

To add /sbin to your path, in a console,

PATH=$PATH:/sbin
export $PATH

Or, all in one line:

export PATH=$PATH:/sbin

Then add it to ~/.bashrc to have it every time you boot up.
 
Old 04-14-2008, 06:41 PM   #4
LinuxUser101
Member
 
Registered: Feb 2008
Location: Earth
Distribution: RHEL
Posts: 32

Original Poster
Rep: Reputation: 15
echo $PATH produces:

/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:
/home/Linuxuser101/bin
 
Old 04-14-2008, 06:47 PM   #5
LinuxUser101
Member
 
Registered: Feb 2008
Location: Earth
Distribution: RHEL
Posts: 32

Original Poster
Rep: Reputation: 15
Thanks! It works now.
 
Old 04-14-2008, 10:57 PM   #6
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,603
Blog Entries: 25

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
Hi,

You should setup a .bashrc & .bash_profile for your user;

Code:
sample .bashrc;
:~$ cat .bashrc

#.bashrc
#08-30-06 12:20 gws copied loki:/root
#
#06-27-07 13:06 gws added from odin for willi
#
#06-27-07 13:14 gws added from oden:root to /home/gws/.bashrc

# Add bin to path

export PATH="$PATH:/sbin:/usr/sbin:$HOME/bin"

#export PATH="$PATH:$HOME/bin"

# Dynamic resizing
shopt -s checkwinsize

# Custom prompt
#PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

#08-29-06 11:40 gws

if [ `id -un` = root ]; then
   PS1='\[\033[1;31m\]\h:\w\$\[\033[0m\] '
 else
   PS1='\[\033[1;32m\]\h:\w\$\[\033[0m\] '
fi

#
# Add color
eval `dircolors -b`

# User defined aliases
alias cls='clear'
alias clls='clear; ls'
alias ll='ls -l'
alias lsa='ls -A'
alias lsg='ls | grep'
alias lsp='ls -1 /var/log/packages/ > package-list'
alias na='nano'
alias web='links -g -download-dir ~/ www.google.com'

#08-29-06 11:50 gws

#To clean up and cover your tracks once you log off
#Depending on your version of BASH, you might have to use
# the other form of this command
   trap "rm -f ~$LOGNAME/.bash_history" 0

#The older KSH-style form
#   trap 0 rm -f ~$LOGNAME/.bash_history
Code:
sample .bash_profile;

~$ cat .bash_profile
# .bash_profile
#08-30-06 12:21 gws copied loki:/root
#06-27-07 13:10 gws copied from odin:root for willi
#06-27-07 13:17 gws copied from odin:root for /home/gws
#
# Source .bashrc
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
The .bashrc is very useful!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
terminal question Anas_b Linux - Newbie 6 06-29-2006 10:21 PM
terminal question gonzalezjay Linux - General 7 10-16-2003 07:05 PM
Terminal question dsgdevil Linux - Software 6 08-26-2003 11:44 PM
Terminal question SnowSurfAir Linux - Software 2 08-17-2003 08:22 PM
terminal question DrOzz Linux - General 3 06-22-2003 12:15 AM


All times are GMT -5. The time now is 04:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration