Find the answer to your Linux question:
Results 1 to 5 of 5
I have no idea what happened but here's the situation: 1. If I execute any app that is installed in the root (bin or whatever), such as "tar" or "ls" ...
  1. #1
    Just Joined!
    Join Date
    May 2008
    Posts
    37

    Help! All apps in /bin giving error: "cannot execute binary"

    I have no idea what happened but here's the situation:

    1. If I execute any app that is installed in the root (bin or whatever), such as "tar" or "ls" or "su" it says:
    Code:
    bash: /home/MyUserName/bin/ls: cannot execute binary file
    or
    bash: /home/MyUserName/bin/tar: cannot execute binary file
    or
    bash: /home/MyUserName/bin/su: cannot execute binary file
    NOTE: the above happens when i just type "tar" at the command line or "ls" with no path.

    2. If I execute the app directly (such as "/bin/tar") it works!

    What could have happened? How do i fix this?


    NOTE: If I do "echo $PATH", I see /bin in there!

  2. #2
    Linux Newbie
    Join Date
    Apr 2009
    Posts
    160
    NOTE: If I do "echo $PATH", I see /bin in there!
    can you post the output of your $PATH please? I know you said it's in there, but could you post it any way please. Could be a typo somewhere.

  3. #3
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    what is contents of this directory? /home/MyUserName/bin/

    Probably that directory is first on the path, and if those commands exist in there, they will be used, rather than the ones that are in /bin.

  4. #4
    Linux Newbie
    Join Date
    Apr 2009
    Posts
    160
    Quote Originally Posted by coopstah13 View Post
    what is contents of this directory? /home/MyUserName/bin/

    Probably that directory is first on the path, and if those commands exist in there, they will be used, rather than the ones that are in /bin.
    Then they would still run and it would be permission errors on the directory listing. If it's in his ~ dir, he shouldn't be having a problem running anything in ~/bin

  5. #5
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568

    Red face

    May be his admin/friend play this trick on him.Creating a "bin" directory on his ~
    and placing binaries with root permission - Just my guess.


    Post output of following commands !!

    echo $PATH
    ls -l /home/MyUserName/bin/
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

Posting Permissions

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