How do I divide in the Linux console?

后端 未结 12 1986
情话喂你
情话喂你 2020-12-25 10:41

I have to variables and I want to find the value of one divided by the other. What commands should I use to do this?

12条回答
  •  春和景丽
    2020-12-25 11:26

    I still prefer using dc, which is an RPN calculator, so quick session to divide 67 by 18 with 4 digits precision would look like

    >dc
    4k
    67
    18/p
    3.7222
    q
    >
    

    Obviously, much more available: man dc

提交回复
热议问题