[ale] THANKS to all who replied to "ls -rt | rm -i" problem, BUT...ATTN:JoeKnapka

Courtney Thomas cc.thomas at earthlink.net
Sat Mar 18 13:51:49 EST 2006


Paul,

I should've been more explicit,...I agree and understood that the f9 was 
presumed to be the 9th field but my understanding is that fields begin 
with 0 and as I [mis]count there are only 8 fields in your example file 
which would make the filename field #7, but apparently I'm wrong 
somewhere, hence my question to Joe.

But even if you start counting at 1 instead of with 0, there are still 
only 8 fields or I'm, again somehow, confused.

Cordially,
Courtney



Paul Cartwright wrote:
> On Sat March 18 2006 12:50 pm, Courtney Thomas wrote:
> 
>>I should ask though, how'd you come up with "-f 9" in cut ?
>>
>>Courtney
>>
>>Joe Knapka wrote:
>>
>>>Hi Courtney,
>>>
>>>This worked for me just now, to interactively
>>>remove files modified on March 15:
>>>
>>>rm -i $(ls -l | grep 'Mar 15' | cut -d ' ' -f 9)
> 
> 
> cut -d means delimited by , ' ' means the delimiting factor is a space
> -f 9 means the 9th field
> 
> so I'm guessing the 9th field would be the name of the file from this 
> ls -l output..
> 
> -rwxr-xr-x   1 root root       6552 2005-09-12 19:47 zvbi-chains
> 
> 



More information about the Ale mailing list