bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#6251: How only show time of files with ls?


From: Pádraig Brady
Subject: bug#6251: How only show time of files with ls?
Date: Sun, 23 May 2010 01:08:16 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]