From owner-freebsd-questions Fri Oct 12 19:35:42 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-65-31-203-60.mmcable.com [65.31.203.60]) by hub.freebsd.org (Postfix) with SMTP id 6564637B408 for ; Fri, 12 Oct 2001 19:35:38 -0700 (PDT) Received: (qmail 16930 invoked by uid 100); 13 Oct 2001 02:35:34 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15303.43126.44123.116068@guru.mired.org> Date: Fri, 12 Oct 2001 21:35:34 -0500 To: Randy Bush Cc: questions@freebsd.org Subject: Re: date of a file In-Reply-To: <73720831@toto.iv> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ 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 types: > i want to get the mtime of a file from a shell, so i can format it purty > and do something with it. > > 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? date +%y%m%d-%H%M%S -jf "%b %d %H:%M:%S" `ls -lT filename | awk ' { print $6, $7, $8, $9 } '` There are problably other ways to do it as well. http://www.mired.org/home/mwm/ Q: How do you make the gods laugh? A: Tell them your plans. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message