Re: How to sort by date in descending order

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Cahilig wrote:
> Hi,
> 
> Guys I need your help, I have a text file which contains these data
> below, and I want to sort it by date in descending order. I tried to use
> sort -rn command but it gives me different output. I know I missing
> something but I just can't figure it out.
> 
> files     03-Sep-2009
[...]
> files     07-Jul-2006
> 
> Your help is very much appreciated. Thanks.

while read a b; do s1=`date --date "$b" +%s`; echo $s1 $a $b;done <yourfile.txt | sort -nr

-- 
   Roberto Ragusa    mail at robertoragusa.it
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux