Re: OT: Alternatives to ls for sorting files by modification time
Hi Vineet!
Thanks a lot for your quick reply!
On Wed, 25 Sep 2002, Vineet Kumar wrote:
> [...]
> processing the list, i.e. with xargs? It's hard to make suggestions
> without seeing what you're trying to do...
You're right ;-) What I'm doing is
FILES=`$LS -lt1 $BACKUP_DIR/arc/*.arc | $TAIL -$NUM_OF_FILES`
for i in $FILES; do
$RM -f $i
done
($LS contains the path to "ls" and $TAIL the path to "tail")
I want to remove the oldest $NUM_OF_FILES files and it seems to me that
piping into tail fails when ls returns too many files.
Thanks in advance for any advice/info!
Greetings,
Holger
Reply to: