LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 07-02-2009, 01:21 AM   #1
gitecravirs
Member
 
Registered: Mar 2009
Posts: 40

Rep: Reputation: 15
Unhappy how to set path for "ifconfig" command permanentaly


Hi Everyone,
I have to give /sbin/ifconfig command to know my ip address, i want to know it by only giving "ifconfig" command.i am facing problem with setting the path for "ifconfig" command permanentaly.i can set it temporarily by giving the command "export PATH=/sbin/:$PATH"
but i dont kmow how to set the path permanentaly.
Help Me.... Thanks
 
Old 07-02-2009, 01:36 AM   #2
PMP
Member
 
Registered: Apr 2009
Location: ~
Distribution: RHEL, Fedora
Posts: 381

Rep: Reputation: 58
write export PATH=/sbin/:$PATH in your .bash_profile file.

Log off and then login again or do
source ./.bash_profile
 
Old 07-02-2009, 02:02 AM   #3
gitecravirs
Member
 
Registered: Mar 2009
Posts: 40

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by PMP View Post
write export PATH=/sbin/:$PATH in your .bash_profile file.

Log off and then login again or do
source ./.bash_profile
i have too many bash files, please tell me in which bash file should i make change?
i have following bash files-->
/usr/share/menu/bash
/usr/share/doc/bash
/usr/share/bash
/bin/bash
 
Old 07-02-2009, 02:44 AM   #4
PMP
Member
 
Registered: Apr 2009
Location: ~
Distribution: RHEL, Fedora
Posts: 381

Rep: Reputation: 58
give me the output of this command

ls -a ~
 
Old 07-02-2009, 02:46 AM   #5
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 293Reputation: 293Reputation: 293
Quote:
Originally Posted by gitecravirs View Post
i have too many bash files, please tell me in which bash file should i make change?
What distro are you using? The file that PMP was referring to is in your home directory. You may have to enable "show hidden files" in your distro's file manager (nautilus for gnome, konqueror for KDE, and thunar for XFCE). Or open a terminal and run:
Code:
less ~/.bash_profile
to read the file.
 
Old 07-02-2009, 03:32 AM   #6
gitecravirs
Member
 
Registered: Mar 2009
Posts: 40

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by PMP View Post
give me the output of this command

ls -a ~
Here it is
ls -a ~
. .gconf index.html.5 .rnd
.. .gconfd jeelan snmpd.conf
1023 .gnome2 .lesshst splash.php
.anjuta .gnome2_private .mozilla .ssh
.aptitude .ies4linux .mysql_history .sudo_as_admin_successful
.bash_history index.html naptd_v0.1.tar.gz .synaptic
.bashrc index.html.1 .ncftp .wapi
bin index.html.2 .profile .wireshark
.config index.html.3 .recently-used
.dbus index.html.4 .recently-used.xbel
 
Old 07-02-2009, 04:32 AM   #7
PMP
Member
 
Registered: Apr 2009
Location: ~
Distribution: RHEL, Fedora
Posts: 381

Rep: Reputation: 58
Just edit your .profile file in the home directory

do
vi ~/.profile

add following lines at the end of it

export PATH=/sbin/:$PATH

save it. logout and then re login.

now ifocnfig should rum without absolute path setting
 
Old 07-02-2009, 04:39 AM   #8
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Quote:
Originally Posted by PMP View Post
logout and then re login.
No need to log out and log in again, just source the .profile or .bash_profile or .bashrc file (depending on where you added the PATH line), and you're good to go. Choose from one of the options below:
Code:
bash-prompt $ . ~/.profile
bash-prompt $ . ~/.bash_profile
bash-prompt $ . ~/.bashrc
 
  


Reply



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
Why "-bash: ifconfig : command not found" when typing "$ifconfig" dangdtvn Linux - Server 9 09-20-2013 06:01 AM
which file can i set "ifconfig eth0 up"? Mathsniper Debian 6 04-27-2005 02:17 PM
problem using ifup and ifconfig "command not found" sicgixxer Linux - Networking 2 11-11-2004 09:39 PM
ifconfig "command not found"...? GDDYUP Linux - Networking 1 09-30-2001 01:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:14 PM.

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
Open Source Consulting | Domain Registration