79689296

Date: 2025-07-03 18:08:55
Score: 2
Natty:
Report link

field 22 of /proc/1/stat has the start time of the container (in jiffies)

field 22 of /proc/self/stat has the current time (in jiffies)

so...

$(( ( $(cut -d' ' -f22 /proc/self/stat) - $(cut -d' ' -f22 /proc/1/stat) ) / 100 ))

gives you the container uptime in seconds.

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: spacezorro