Listing only the most recent file

Oliver Marshall oliver.marshall at g2support.com
Tue Oct 16 10:31:35 UTC 2012


Sorted it :)

ls -rt -1 | tail -1

On 16 October 2012 11:26, Oliver Marshall <oliver.marshall at g2support.com>wrote:

> Hi chaps
>
> I need some help with an ls syntax.
>
> I want to show *only* the most recent file.
>
> "ls -St -1" gives me the contents of a dir with the most recent on top but
> I want only that most recent file shown.
>
> Can this be done?
>
> Olly
>

-- 
Network Support
Online Backups
Server Management

Tel: 0845 307 3443
Web: http://www.g2support.com
Twitter: g2support <http://twitter.com/home?status=@g2support>
Google+: http://www.g2support.com/plus
Facebook: http://www.facebook.com/g2support
Mail: Unit H, Hove Technology Centre, Hove, Sussex, BN3 7ES

Have you said something nice about us to a friend or colleague ? Let us say 
thanks. Find out more at www.g2support.com/referral

G2 Support LLP is registered at Mill House, 103 Holmes Avenue, HOVE
BN3 7LE. Our registered company number is OC316341.

      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20121016/0e4f08f0/attachment.html>


More information about the ubuntu-users mailing list