shell - Using timestamp of a particular command in bash script? -
I am trying to use the timestamp of a special order that is already running on the line of History 10 Something is going on Grep "keyword"
gives me output in the command line (my history preferences are set to include a timestamp), but I can not really understand this information as a script How to use it in
using it Is there a way or is there another way of getting a timestamp from a specific command? I'm trying to decide to run a command
last time, and if it was longer than a specific time, then run it again.
export HISTTIMEFORMAT = "% F% T"
/ Pre>Then you can use this command
history | GRP LS | Grep -v grep | Tail-1 Note: I am searching for the LS command and I am printing a timestamp of ls
/ Strong> when it Last used was
Comments
Post a Comment