Hi, ALL
thanks in advance,
i listed all files using this command
ls -ltr $(date +%Y%m%d)*.xml
but i would like to exclude the last one created ;
Best regard
MEROUAN
Hi, ALL
thanks in advance,
i listed all files using this command
ls -ltr $(date +%Y%m%d)*.xml
but i would like to exclude the last one created ;
Best regard
MEROUAN
Try:
ls -lt $(date +%Y%m%d)*.xml | awk 'NR>1'
hideous, but it works
ls -ltr $(date +%Y%m%d)*.xml | head -$(( $(ls -ltr $(date +%Y%m%d)*.xml | wc -l) - 1 ))
And Bartus' solution above is infinitely better, reminding me once again that I must go through a good book on awk
Add ... | sed '$d'
to your command.
If the desc order doesn't matter:
ls -lt "$(date +%Y%m%d)"*.xml | tail -n +1
yes it works i use Skrynesaver solution .
THANKS ALL FOR TIME