Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

13
  • Are you looking for time delta expressed in a particular format, I.E. "HH:MM:SS"? Also, why not just log UNIX timestamps? Commented Aug 18, 2017 at 16:21
  • 1
    @Marco see the link in my comment for several ways to calculate the unix timestamp. Commented Aug 18, 2017 at 16:29
  • 1
    @Jesse_b found it, TY! Commented Aug 18, 2017 at 16:32
  • 1
    Oh I also just noticed you are parsing ls in your script. You shouldn't do this. You can do for i in "/var/log/logfolder/*"; instead. mywiki.wooledge.org/ParsingLs Commented Aug 18, 2017 at 16:43
  • 2
    @Jesse_b that's not really any different to using ls -t; you're still parsing the output of a command that generates a list of filenames. (Oh, -name "*" is almost a no-op; you wouldn't need it here. And how would sort -n be able to sort file names numerically?) Commented Aug 18, 2017 at 21:44