tar command not found


Results 1 to 11 of 11

Thread: tar command not found

  1. #1
    Join Date
    Aug 2002
    Location
    Philadelphila, Pa
    Posts
    25

    tar command not found

    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

  2. #2
    Join Date
    Sep 2004
    Location
    /home/
    Posts
    1,204
    do you have your path exported?

    might wanna add /usr/bin ... as a note

    did you relogin after making changes

    soule
    Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others. - Edward Abbey

    IRC #linuxn00b

    Support your Distro.
    Slackware Store
    Archlinux Schwag

  3. #3
    Join Date
    Apr 2003
    Location
    Buenos Aires, Argentina
    Posts
    4,219
    set | grep PATH

    You can use that command to check if you have the PATH variable exported.
    djserz.com.ar
    "All the drugs in this world won't save you from yourself..."

  4. #4
    Join Date
    Oct 2002
    Location
    Illinois
    Posts
    3,281
    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

  5. #5
    Join Date
    Aug 2002
    Location
    Philadelphila, Pa
    Posts
    25

    tar command not found

    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

  6. #6
    Join Date
    Sep 2004
    Location
    /home/
    Posts
    1,204
    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
    Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others. - Edward Abbey

    IRC #linuxn00b

    Support your Distro.
    Slackware Store
    Archlinux Schwag

  7. #7
    Join Date
    Aug 2002
    Location
    Delaware
    Posts
    4,285
    maybe because you had /usr/bin/ instead of /usr/bin

    dunno if the path variable is that insitant on correctness.
    irc.freenode.net #justlinux The Not So Official JL IRC Channel.
    ¤ Debian ¤ Apt-Get ¤

  8. #8
    Join Date
    Sep 2004
    Location
    /home/
    Posts
    1,204
    dunno if the path variable is that insitant on correctness.
    it probably is


    soule
    Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others. - Edward Abbey

    IRC #linuxn00b

    Support your Distro.
    Slackware Store
    Archlinux Schwag

  9. #9
    Join Date
    Apr 2001
    Location
    SF Bay Area, CA
    Posts
    14,936
    Um, guys?

    Quote Originally Posted by PhilBill
    "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

    ?

  10. #10
    Join Date
    Sep 2004
    Location
    /home/
    Posts
    1,204
    heh, talk about not seeing the forest for the trees


    soule
    Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others. - Edward Abbey

    IRC #linuxn00b

    Support your Distro.
    Slackware Store
    Archlinux Schwag

  11. #11
    Join Date
    Apr 2003
    Location
    Buenos Aires, Argentina
    Posts
    4,219
    lol, bwkaz rocks
    djserz.com.ar
    "All the drugs in this world won't save you from yourself..."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •