This question already has an answer here:

$ bash date
/bin/date: /bin/date: cannot execute binary file

$ bash -c date
Thu Apr 14 19:27:08 EDT 2016

What does the error message of bash date mean? What does bash expect date to be?

marked as duplicate by EightBitTony, Flup, don_crissti, dr01, taliezin Apr 15 '16 at 9:49

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


The reason bash throws this error is becaue /bin/date is a binary file. It expects it to be a shell script, and it would work if it was.

bash file

means you execute a shell script called file, but with -c it reads the input as a sequence of bash commands.

Not the answer you're looking for? Browse other questions tagged or ask your own question.