Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
$ echo 2*1024|bc
$ echo 2.0*1024|bc
$ echo 2*1024.0|bc

What's going on here then?


dc manages fine

$ echo "2 1024 * p"|dc
share|improve this question
up vote 5 down vote accepted

If you put the bc sum (2*1024) in single quotes (') does it make a difference? It could well be that the shell is interpreting the * as a wildcard and expanding it in some way.

$ echo '2*1024' | bc

should give you better results.

share|improve this answer
Aha! Turns out I had a file called 20*1024 for some reason. – Stephen Paulger Mar 10 '11 at 10:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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