Why does bash <command> fail to run?

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

$ /bin/date
Fri Mar 18 05:59:24 EDT 2016

$ bash -c date
Fri Mar 18 06:00:39 EDT 2016

2 Answers 2


From the manual:

If arguments remain after option processing, and neither the -c nor the -s option has been supplied, the first argument is assumed to be the name of a file containing shell commands.

So bash date means "read the date file and execute the shell commands it contains". Assuming there is no date file in the current directory, bash searches the path and finds /bin/date which is a binary rather than a shell script, hence the error.


Without -c bash tries to run the argument as its script. The /bin/date is not a bash script, so it fails.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .