From owner-freebsd-questions Fri Oct 12 18:21:40 2001 Delivered-To: freebsd-questions@freebsd.org Received: from lists.blarg.net (lists.blarg.net [206.124.128.17]) by hub.freebsd.org (Postfix) with ESMTP id D49D537B40C for ; Fri, 12 Oct 2001 18:21:37 -0700 (PDT) Received: from thig.blarg.net (thig.blarg.net [206.124.128.18]) by lists.blarg.net (Postfix) with ESMTP id 7CAF8BCFD; Fri, 12 Oct 2001 18:21:37 -0700 (PDT) Received: from localhost.localdomain ([206.124.139.115]) by thig.blarg.net (8.9.3/8.9.3) with ESMTP id SAA32396; Fri, 12 Oct 2001 18:21:37 -0700 Received: (from jojo@localhost) by localhost.localdomain (8.11.6/8.11.3) id f9D1L0M51629; Fri, 12 Oct 2001 18:21:00 -0700 (PDT) (envelope-from swear@blarg.net) To: Randy Bush Cc: freebsd-questions@FreeBSD.ORG Subject: Re: date of a file References: From: swear@blarg.net (Gary W. Swearingen) Date: 12 Oct 2001 18:21:00 -0700 In-Reply-To: Message-ID: <9k669ks5c3.69k@localhost.localdomain> Lines: 18 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Randy Bush writes: > in gnu-sh-utils, i can, for example, > > date -r filename +%y%m%d-%H%M%S > > but, in freebsd, "date -r" says give me the current date in seconds of the > epoch. > > what should i be doing? Using python or perl or awk? This gets close: ls -lT filename | awk '{printf "%s %s %s %s\n",$9,$6,$7,$8}' And I think the "date" command can convert dates from, say an output of "ls" like the above (as $(ls...|awk...)) into fancy formatted outputs (it uses strptime(3)) formats. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message