[Tfug] Command-line fun

Stott, Will will.stott at ventana.roche.com
Thu May 14 09:20:57 MST 2009


Try: ls | tail -<n> for example "ls | tail -10" would limit to the last 10
results.

 

Will

 

  _____  

From: tfug-bounces at tfug.org [mailto:tfug-bounces at tfug.org] On Behalf Of
Christopher Robbins
Sent: Thursday, May 14, 2009 9:18 AM
To: Tucson Free Unix Group
Subject: [Tfug] Command-line fun

 

Is there an easy way to limit the results of an "ls" command to the last 10
(20, 30, n) results
via the command-line? 

I have a Windows box running Cygwin (I can't have linux on this one :( ),
and I'm trying to run
a one-liner that will pull out the last 10 logs and see what version of
software it ran.  I know how
to run fgrep through it, then pull the version info out with sed - I just
can't wrap my head around limiting
the results with "ls".

Any ideas? 

Thanks, 

   - Chris

PS - I know I'm not as active on the list as I used to be (and I always
missed the happy hour), but I finally left UA last month.  
Found greener pastures in private industry - I think it was more than
overdue...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tfug.org/pipermail/tfug_tfug.org/attachments/20090514/a809f5f3/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6385 bytes
Desc: not available
URL: <http://tfug.org/pipermail/tfug_tfug.org/attachments/20090514/a809f5f3/attachment-0002.bin>


More information about the tfug mailing list