Click to See Complete Forum and Search --> : tar command not found
PhilBill
09-05-2005, 11:44 PM
I got the following error message when using tar:
"bash: tar -zhcvf : command not found"
When I used which tar I got "/bin/tar"
The path in my .bash_profile reads:
$PATH=/usr/sbin:/sbin:/bin
I assume something is wrong with PATH but I'm not sure what.
I'm using Fedora 4.
Thanks,
Bill
soulestream
09-06-2005, 01:40 AM
do you have your path exported?
might wanna add /usr/bin ... as a note
did you relogin after making changes
soule
set | grep PATH
You can use that command to check if you have the PATH variable exported.
dkeav
09-06-2005, 03:16 AM
hopefully its more like export PATH=/some/new/path/to/something/exciting:/second/cool/path:$PATH (<-- for existing paths attached to the end of your new path)
you can also set the variable earlier in the profile and export it later with PATH=.... and export PATH somewhere else, but okham's razor, use the one liner ;)
PhilBill
09-06-2005, 08:11 AM
Many thanks for the responses.
I do have the path exported. It's a line or two under the PATH. I also added
user/bin and "set | grep PATH" which gave me:
PATH=/usr/kerberos/bin:/usr/local/bin:bin:/usr/bin/:usr/x11R6/bin:/usr/sbin:
sbin:/bin/:usr/bin
What I don't understand is that I can use other commands in /bin such as cp,
su, etc but not tar.
Another thing I don't understand about PATH is why there is a difference between the PATH in my .bash_profile and the one I got using grep.
Thanks,
Bill
soulestream
09-06-2005, 09:36 AM
because you have a global path also, which is set somewhere else
like in slackware its /etc/profile
make sure tar is executable.
try using the absolute path first ie
/bin/tar -xvzf filename
to see if it works
it may be a bug or something other than your path
sharth
09-06-2005, 01:23 PM
maybe because you had /usr/bin/ instead of /usr/bin
dunno if the path variable is that insitant on correctness.
soulestream
09-06-2005, 04:35 PM
dunno if the path variable is that insitant on correctness.
it probably is
soule
bwkaz
09-06-2005, 07:05 PM
Um, guys?
"bash: tar -zhcvf : command not found" bash thinks the command that got run was "tar -zhcvf ", not plain old "tar"... ;)
PhilBill, what were you running when you got this error? Did you have a backslash after the "tar" in the command? Did you have the first two words in double or quotes, like this:
"tar -zhcvf" filename
or this:
'tar -zhcvf' filename
?
soulestream
09-06-2005, 10:49 PM
heh, talk about not seeing the forest for the trees
soule