Tuesday, August 22, 2017

find the most recently modified file in a directory and display its contents.

  this is all i want to do today. just this.  
   
 cat "$(ls -lt `find $PWD -type f -name "*" ` |awk '{print $9}' | head -1)"  
   
 gross. the output is too long.  
   
 tail -n 10 "$(ls -lt `find $PWD -type f -name "*" ` |awk '{print $9}' | head -1)"  

No comments: