Wednesday, 15 May 2013

bash - How to sort lists with chronological order in Linux Terminal? -



bash - How to sort lists with chronological order in Linux Terminal? -

i have next command in linux terminal(fedora-20)

stat -c "the file "%n" modified on "%y ** | awk 'begin{ofs=" "}{for(i=1;i<=7;++i)printf("%s ",$i)}{print "at " substr($8,0,5)}' | sort -nr

this command gives me output this:

file question5.sh modified on 2014-10-29 @ 17:30 file question4.sh modified on 2014-10-29 @ 17:30 file question2.sh modified on 2014-11-01 @ 22:51 file question2.sh~ modified on 2014-11-01 @ 22:51 file question1.sh modified on 2014-10-29 @ 18:37 file question1.sh~ modified on 2014-10-29 @ 17:53

sort -nr not working in case unfortunately..

how can sort list in chronological order?

this seems work if want sort date , time

sort -s -k7 -k9

linux bash list shell terminal

No comments:

Post a Comment