$ date -d "2 days ago" "+%e/%b/%Y" 28/Mar/2011 $ grep "28/Mar/2011" input.txt #### $ grep `date -d "2 days ago" "+%e/%b/%Y"` input.txt