Best Answer: How Do You Subtract Time in Linux?
Contents

How do you subtract time in Unix?

Subtract two rows (in Time format)

log | grep -v ZZZ | awk ‘{print $1 ” ” $2 “;” $3 “;” $9 “;” $11}’ > myfile. csv sed -i ‘1iDate;Time;From;To’ myfile. csv => it is clear that it converts log to csv and add a header.

How do you subtract in Shell?

The following arithmetic operators are supported by Bourne Shell.
…
Unix / Linux – Shell Arithmetic Operators Example.

Operator Description Example
– (Subtraction) Subtracts right hand operand from left hand operand `expr $a – $b` will give -10
Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article
Twitter Facebook Pinterest