[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help: Bash script that show you the last file created?
From: |
Mike Frysinger |
Subject: |
Re: Help: Bash script that show you the last file created? |
Date: |
Sun, 15 Feb 2009 19:55:15 -0500 |
User-agent: |
KMail/1.11.0 (Linux/2.6.28; KDE/4.2.0; x86_64; ; ) |
On Sunday 15 February 2009 10:32:15 tal396 wrote:
> hey, i created a backup dir that created backup every hours...
> there is any way to get the last file that created that is fomat is *.sql
> ?
> thats what i've done, but its not working so well...
>
>
> cd "/home/server/backups/local_backups/" ; find -type d | find . -name
> '*.sql' | tac | tail -1;
why not just use `ls` and one of its sort options ? the ls man page documents
how to sort by creation time
-mike
signature.asc
Description: This is a digitally signed message part.