If grep doesn't get rid of the output, it's most likely being printed on standard error. The simplest way to get rid of that is to simply dump it:

tail -f messages.log 2&gt;/dev/null


Suppress 'file truncated' messages when using tail
I am trying to loop through all the post to get the top most shared posts on social network. I want to use the date_query parameter in the WP_query to get the posts of last two days , last 5 days, last 7 days and last 9 days. How can i implement it through using the date_query in WP_Query 
My WP_query is

&lt;?php
 $args = array(
  'post_type' =&gt; 'post',
  'order'=&gt;'DESC',
  'posts_per_page' =&gt; 1,
  'date_query' =&gt; array(
                     array(
        'after'     =&gt; '10 days ago',
        'inclusive' =&gt; true,
       ),
     ),
  'orderby'=&gt;'meta_value',
  'meta_key'=&gt;'esml_socialcount_TOTAL'
  );
 $the_query = new WP_Query($args);
 if($the_query-&gt;have_posts()) { 
 while ($the_query-&gt;have_posts()){$the_query-&gt;the_post();
?&gt;

