LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-28-2010, 09:31 AM   #1
eng_mohammedmostafa
Member
 
Registered: Nov 2008
Location: Egypt
Posts: 108
Blog Entries: 1

Rep: Reputation: 16
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?
 
Old 04-28-2010, 09:32 AM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

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

Code:
/sbin/fdisk
 
Old 04-28-2010, 09:32 AM   #3
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
It's in /sbin and /sbin is not in your $PATH
 
Old 04-28-2010, 09:39 AM   #4
eng_mohammedmostafa
Member
 
Registered: Nov 2008
Location: Egypt
Posts: 108

Original Poster
Blog Entries: 1

Rep: Reputation: 16
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
 
Old 04-28-2010, 09:41 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by eng_mohammedmostafa View Post
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
 
Old 04-28-2010, 09:44 AM   #6
eng_mohammedmostafa
Member
 
Registered: Nov 2008
Location: Egypt
Posts: 108

Original Poster
Blog Entries: 1

Rep: Reputation: 16
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

Last edited by eng_mohammedmostafa; 04-28-2010 at 09:59 AM.
 
Old 04-28-2010, 09:54 AM   #7
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Did you log out and back in after changing .bash_profile?

Does using the full path (/sbin/fdisk) on the command line work ?
 
Old 04-28-2010, 10:01 AM   #8
eng_mohammedmostafa
Member
 
Registered: Nov 2008
Location: Egypt
Posts: 108

Original Poster
Blog Entries: 1

Rep: Reputation: 16
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
.............
 
Old 04-28-2010, 10:04 AM   #9
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by eng_mohammedmostafa View Post
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

Last edited by centosboy; 04-28-2010 at 10:06 AM.
 
Old 04-28-2010, 10:04 AM   #10
eng_mohammedmostafa
Member
 
Registered: Nov 2008
Location: Egypt
Posts: 108

Original Poster
Blog Entries: 1

Rep: Reputation: 16
Dears,,

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

Thanks again
 
Old 04-28-2010, 10:40 AM   #11
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
The Thread Tools menu can be used to mark a thread SOLVED.
 
  


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
grub fdisk command not found pavankonka Linux - Laptop and Netbook 3 02-08-2006 05:06 PM
fdisk/parted/cfdisk: command not found indole Linux - Software 2 02-17-2005 12:08 PM
fdisk command not found ryancherry Fedora 2 06-12-2004 06:56 PM
fdisk command not found? tiang_ono Linux - Newbie 7 05-17-2004 10:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:39 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