/proc/uptime in Mac OS X

后端 未结 4 717
不知归路
不知归路 2021-02-08 19:55

I need the EXACT same output as Linux\'s \"cat /proc/uptime\".

For example, with /proc/uptime, you\'d get

1884371.64 38646169.12

4条回答
  •  再見小時候
    2021-02-08 20:44

    There simply is no "/proc" directory on the Macintosh.

    On MacOS, you can do a command like:

    sysctl kern.boottime 
    

    and you'll get a response like:

    kern.boottime: { sec = 1362633455, usec = 0 } Wed Mar  6 21:17:35 2013
    

提交回复
热议问题