Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am using Red Hat Linux V7.0.
Was logged on as root and issued fdisk command
# fdisk -l /dev/hda
Bash says no such command exists
I issued a whereis command and found fdisk, I think in the sbin directory.
What's going on?
[Edited by rdaves@earthlink.net on 05-22-2001 at 12:44 AM]
I have read the man page and tried to use fdisk accordingly. Every time I issue the command, bash comes back and tells me the command does not exist. I did a "whereis" and found fdisk in the /sbin directory. I cd'd to sbin and issued the command "fdisk -l /dev/hda", also "fdisk -l". In both cases I get "bash: fdisk: command not found".
I am issuing the command as root in the /sbin directory.
I have rebooted and tried again with same results.
Is there any reason why this command is not working? Something else needs to be tweaked first? I have inadvertantly set some flag somewhere?
I've found that the path in Linux does not work the same as in Dos. In Dos the command processor looks first at the directory you are in. In Linux, I've found that it may not look at the current directory at all. So, changing to sbin may not have done anything.
Try:
/sbin/fdisk ...
By default the '.' (current directory) is not in root's path. Try typing the command 'echo $PATH' and I'm sure you will not find a '.' in there. You can add the '.' to you path with the command:
PATH=$PATH:.
or you can add /sbin to your path:
PATH=$PATH:/sbin
or, as others suggested either type the full path /sbin/fdisk or if you are in the directory you can type ./fdisk
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.