The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 07-06-2009
kshji's Avatar
kshji kshji is offline
Registered User
  
 

Join Date: Jun 2009
Location: Finland
Posts: 236
Example day Jul 2
Code:
ls -alt HSM_VERIF.* | grep " Jul  2 " | sed -n '3,$p' |  xargs rm -f
Or
Code:
ls -alt HSM_VERIF.* | grep " Jul  2 " | sed -n '3,$p' | while read line
do
      rm -f "$line"
done