LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   bash: fdisk: command not found (https://www.linuxquestions.org/questions/linux-software-2/bash-fdisk-command-not-found-804767/)

eng_mohammedmostafa 04-28-2010 09:31 AM

bash: fdisk: command not found
 
Dears,,

I am trying to use fdisk command as following but it gave me error . .
[root@rac2 ~]# fdisk
bash: fdisk: command not found

I am running on Oracle Enterprise Linux 32-bit
Why this?

rweaver 04-28-2010 09:32 AM

Well the answer is obvious-- it's not in the path, try calling it by the full path name.

Code:

/sbin/fdisk

AlucardZero 04-28-2010 09:32 AM

It's in /sbin and /sbin is not in your $PATH

eng_mohammedmostafa 04-28-2010 09:39 AM

But the path already defined in .bash_profile as following . . .

# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PS1="`/bin/hostname -s`-> "
export EDITOR=vi
export ORACLE_SID=devdb2
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORA_CRS_HOME=$ORACLE_BASE/product/10.2.0/crs_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin
umask 022

export PATH
unset USERNAME

catkin 04-28-2010 09:41 AM

Quote:

Originally Posted by eng_mohammedmostafa (Post 3950658)
export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin

/usr/sbin is not the same directory as /sbin

eng_mohammedmostafa 04-28-2010 09:44 AM

Even i added /sbin in .bash_profile
it is the same error

PATH=$PATH:$HOME/bin:/sbin

export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11R6/bin

AlucardZero 04-28-2010 09:54 AM

Did you log out and back in after changing .bash_profile?

Does using the full path (/sbin/fdisk) on the command line work ?

eng_mohammedmostafa 04-28-2010 10:01 AM

Quote:

Did you log out and back in after changing .bash_profile?
No
It is must after changing .bash_profile?

Quote:

Does using the full path (/sbin/fdisk) on the command line work ?
Yes
[root@rac2 ~]# /sbin/fdisk -l
Disk /dev/sda: 21.4 GB, 21474836480 bytes
.............

centosboy 04-28-2010 10:04 AM

Quote:

Originally Posted by eng_mohammedmostafa (Post 3950691)
No
It is must after changing .bash_profile?


Yes
[root@rac2 ~]# /sbin/fdisk -l
Disk /dev/sda: 21.4 GB, 21474836480 bytes
.............

kind of.

you either log out then back in or run

Code:

source .bash_profile
then try again

eng_mohammedmostafa 04-28-2010 10:04 AM

Dears,,

Thanks for all of you . . .
It is working fine now.
I log out then back again and it worked fine.

Thanks again

catkin 04-28-2010 10:40 AM

The Thread Tools menu can be used to mark a thread SOLVED.


All times are GMT -5. The time now is 12:07 PM.