As it says in the title, my RaspberryPi can't execute some basic commands (e.g. ls, mkdir, su, ...) with the user 'pi'. I always get the following as output:
-bash: /home/pi/bin/ls: Cannot execute binary file: Exec format error
If I sudo these commands or execute them on any other account, even an account who can't even sudo, it works fine, and it already worked fine at my last login (OK, about 2 weeks ago...) and I didn't install any new software (I read that's often causing this problem), I only used an already-good-known-software which uses the YouTube-API to upload a video. I tried to fix the issue via reboot (it doesn't work often, but sometimes it helps :D). I read about a modified $PATH-Variable, and I think this could be true, but I am not the biggest pro and can't proof it, so here is the output:
echo $PATH
/home/pi/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
As I already said, I think this could really be the reason (that's really confusing, I didn't even know there are such folders), but even if it was, I wouldn't know what to change it to, so I thougt you could say me it's something different or how I have to set the $PATH-Variable. And, maybe, how this could have changed, I didn't do that manually.
I hope someone can help me. Thanks in advance, a Noob
EDIT:
I solved the problem in some ways with the marked answer. I just deleted the /home/pi/bin folder (/bin/rm /home/pi/bin
to use the rm
in /bin/
) and logged out (exit
) and in to run ~/.profile again. And I was also able to reconstruct how I got these files in there: A few days before I canceled my server, so I used my RasPi to backUp the files for future. I created a folder named oldServer
, but forot to cd
in it and just get
ed the files via SFTP, so they came into /home/pi/, also the folder bin
. So at every login, ~/.profile was thinking it would be a special bin and put it into $PATH
. The RasPi wasn't able to execute these binaries in there because they were from Debian too, but not from Raspbian in specific, just Debian8. Thanks for your comments and answers!
ls
in/home/pi/bin
? Those should be in/bin
om Raspbian, IIRC. It looks like you have some other architecture's binaries in/home/pi/bin
.