GNU bug report logs - #6251
How only show time of files with ls?

Previous Next

Package: coreutils;

Reported by: Peng Yu <pengyu.ut <at> gmail.com>

Date: Sat, 22 May 2010 22:37:02 UTC

Severity: normal

Done: Bob Proulx <bob <at> proulx.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 6251 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Peng Yu <pengyu.ut <at> gmail.com>
Cc: 6251 <at> debbugs.gnu.org
Subject: Re: bug#6251: How only show time of files with ls?
Date: Sun, 23 May 2010 01:08:16 +0100
On 22/05/10 23:22, Peng Yu wrote:
> ls -go gives me permission and file sizes. But I only want to show
> time and file names. Would you please let me know what command to use?

You could use cut to show the required columns:

  ls -go | tr -s '[:blank:]' ' ' | cut -d' ' -f4-

Note if we supported `cut -d '[:blank:]'` adjacent
spaces in file names would not be squeezed.

You could also use find:

  find . -maxdepth 1 -printf "%Tx %f\n"

There was also talk of adding format directives to ls,
but there were various issues raised with that:

  http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14977

cheers,
Pádraig.




This bug report was last modified 15 years and 64 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.