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

Re: "fields" in files



On Sun, 30 Jan 2011 14:53:14 +0200, Andrei Popescu wrote:

> On Du, 30 ian 11, 12:47:43, Camaleón wrote:
>> 
>> sm01@stt008:~$ ls -l | awk '{print $9}'
>> 
>> Desktop
>> Documentos
>> file:
>> News
>> PDF
> 
> No need for awk, ls will do that with the -1 (the digit 1) option or by
> default if the output is not a terminal (ex. a pipe).

To get the filename, yes, but how about if you want to fetch a fancy file 
attributes combo output? :-)

sm01@stt008:~$ ls -l --full-time | awk '{print $6, $9}'
 
2011-01-30 Desktop
2010-05-16 Documentos
2009-11-14 file:
2009-12-27 News
2010-12-02 PDF

Greetings,

-- 
Camaleón


Reply to: