Results 1 to 9 of 9
I checked .bashrc and .bash_profile for the root account and my personal account and the PATH seems to be identical.
However, When I run a command such as fdisk under ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-04-2003 #1
bash question
I checked .bashrc and .bash_profile for the root account and my personal account and the PATH seems to be identical.
However, When I run a command such as fdisk under my account I get 'Command not found' while it works fine for root.
Is this a permission thing? In FreeBSD it usually tells me that I don't have permissions. What's the deal here?
- 06-04-2003 #2Linux Engineer
- Join Date
- Nov 2002
- Location
- Queens, NY
- Posts
- 1,319
I think 'fdisk' is under /sbin/fdisk. Since I'm not in linux, I can't tell you where it is but run 'which fdisk'. Once you get the path, use 'ls -l <path>' to see the permissions on it. I'm very sure that the permission is set for root to execute this program.
The best things in life are free.
- 06-04-2003 #3Linux User
- Join Date
- May 2003
- Location
- CA
- Posts
- 370
fsidk is under /sbin/fdisk
if u try to run it as a normal user you'll get the error message
"Cannot open <device>"
you'll haveto run it as root
- 06-04-2003 #4Linux Engineer
- Join Date
- Nov 2002
- Location
- Queens, NY
- Posts
- 1,319
Right so run 'ls -l /sbin/fdisk' This will then give you a long list of the file along with the permissions, date of last modification, and etc. You guys do know how to read permissions don't you?
The best things in life are free.
- 06-04-2003 #5Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
It's no wodner that you found no difference in root's .bash* files. The */sbin dirs are added to the PATH in /etc/profile.
So as a user, either, as has been suggested, run /sbin/fdisk, or do as I have done, add */sbin to your PATH as your user login as well (there you can use the .bash* files, preferably .bash_profile).
- 06-05-2003 #6
That explains it. Is this just a Linux thing? I don't think it works like that in FreeBSD
cheers
- 06-05-2003 #7Linux Newbie
- Join Date
- Apr 2003
- Location
- UK, Manchester
- Posts
- 147
I think its more of a common sense thing.
Why would you want normal users to have access to /sbin or /usr/local/sbin.
Only root should be able to run/access those commands.
- 06-05-2003 #8Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
What did you mean that it was that wouldn't be possible in BSD?
- 06-05-2003 #9
What I meant was that on my freeBSD box, when I create a user and give him the bash shell there appear a lot more directories under PATH than there are in my bash file on RH
Cheers


Reply With Quote
