X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:reply-to:subject:to:references:from:message-id :date:mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=w7dMOMnNVkIVNKux FZpeQ19UGWKyPgFiHTYYwX51sAYV4448p1iDWIKY1nrsP/sVVxcnJsUaOkMP/juL byr1UPg8v+/FqwFF183soU/IqXaiWJnS6iEN5zEas3H6CHiOeCHjdwlQOqjRMa8q Wmxso8eqbiAKQ5Q2gu3TxcNqRUA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:reply-to:subject:to:references:from:message-id :date:mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=FL74+CtyetjN1k2h3/zHPh ZLkZo=; b=PtfepHUtG8FK/wJqHyzsmMMpIZgBVJAYqJNR4YpFUJiQMHN9tQD9YM GyWYnF1LRZ1gMvMZsT7ZjnNqQwUbPUn8bJc2vAc5qeEjHoctSRebhFvV5Fgk6p4a 9LzcV0Dyc2HQttNyLfLmirKut+URTHGkz6cLzinwG7I9CVTydjVNA= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=discretion, brian, readers, Hx-spam-relays-external:shaw.ca X-HELO: smtp-out-no.shaw.ca Reply-To: Brian DOT Inglis AT SystematicSw DOT ab DOT ca Subject: Re: Is who -b command available? Need to know when computer was started. To: cygwin AT cygwin DOT com References: <014001d46565$feedda10$fcc98e30$@yahoo.com> <20181016165745 DOT GA1226 AT phoenix> From: Brian Inglis Openpgp: preference=signencrypt Message-ID: <48af28ec-153c-5ac3-6bf5-eb40f4eac297@SystematicSw.ab.ca> Date: Tue, 16 Oct 2018 20:21:45 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181016165745.GA1226@phoenix> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes On 2018-10-16 10:57, Gary Johnson wrote: > On 2018-10-16, Peder Sverdrup via cygwin wrote: >> I am making a script and need to know when the computer was last booted. >> This can be done with who -b command. I have installed the minimum cygwin >> and this command is not available. >> Which package do I need to install in order to have this command available >> (or any other command that can tell when the computer was last booted). > The procps-ng package provides the uptime command which will tell > you how long it has been since the computer was last booted. /var/run/utmp system startup/shutdown records are not written so who -b shows nothing although who is included in cygwin Base package coreutils /proc/uptime shows number of seconds wall time since startup, and number of seconds idle time since then e.g.: $ cat /proc/uptime; date -d"now - `cut -d' ' -f1 /proc/uptime` seconds"; uptime 115395.52 107152.61 2018 Oct 15 Mon 12:05:18 20:08:34 up 1 day, 8:03, 2 users, load average: 1.81, 1.58, 1.76 -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple