Link to home
Start Free TrialLog in
Avatar of Daizzy-Mae
Daizzy-Mae

asked on

What is the bash version of Chown?

What is the bash version of Chown?

I just get this when I try to use it:

-bash: chown: command not found

Ta x
Avatar of jghelfman40
jghelfman40
Flag of United States of America image

make sure you are using full paths to your binaries


/bin/chown
/usr/local/bin/bash or /bin/bash

type:

which chown
which bash

these will determine where these programs are.
Avatar of Daizzy-Mae
Daizzy-Mae

ASKER

Thank you, just to clarify:

This is what I was needing to type into PuTTY:
chown -R apache ./gnupg-files/.gnupg

which chown gives nothing
which bash gives:
//bin/bash


What should I type in to the command line instead of "chown -R apache ./gnupg-files/.gnupg"?
Try /usr/bin/chown, /usr/local/bin/chown, or /sbin/chown.  If those don't work you could try to find it with:
locate chown
or:
slocate chown

If those don't work, they probably set it up so you can't access it.
Avatar of Joseph Gan
You need to set PATH, what is output of
# echo $PATH
chown isn't a shell command, it's a system binary, therefore it doesn't matter what shell you are using.

The issue is that you don't have /bin in your PATH environment variable.

Type in

echo $PATH

and you'll almost certainly not see /bin

To add on the fly, do

export PATH=$PATH:/bin

and to make it permanent, add that line to ~/.bash_profile
ASKER CERTIFIED SOLUTION
Avatar of Superdave
Superdave
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ah, just re-read the whole thread.

My guess is this is on a VPS where there are restrictions to certain commands like chown.
What system are you on?
What is the result of

which busybox

?
Thank you for all of your help:

SuperDave:
It seems I am not set up to use chown (I am on shared hosting with a big comapny so I guess they don't want people medling).
[timetogoveggie.com@shell1c40 /]$ locate chown
locate: /var/lib/locatedb: No such file or directory

Tintin:
[timetogoveggie.com@shell1c40 /]$ echo $PATH
//bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin

hemmi:
which busybox gives nothing I'm afraid.

Thank you all for your help, I think probably SuperDave is correct that my user is not alowed to use chown as I am on shared hosting.