Using a time command, as others have suggested, is a good idea.
Another option is to use the $ SECONDS magic built-in variable, which contains the number of seconds since the script was run. You can say:
START_TIME=$SECONDS dosomething ELAPSED_TIME=$(($SECONDS - $START_TIME))
I think this is bash-specific, but since you are working on Linux, I assume you are using bash.
Tom Anderson Mar 01 2018-11-11T00: 00Z
source share