Skip to main content
added 326 characters in body
Source Link
  • check to make sure these are the files indeed that you would like to delete and no other

Since you want to keep all files that differ from the format mentioned, do:

  1. Execute this. This will populate FilesToDelete.txt with files/dir to be deleted. Review this to make sure that files listed in are indeed the files you intend to delete.

find /dirpath/thatto/containsdir/esymac_logEvents.log* | xargs ls -l > FilesToDelete.txt

  • Once you verify the first step, execute this command
  1. Once you verify the Step-1, do

find /path/to/dir/esymac_logEvents.log* -type f | xargs rm -f

  1. If directories are involved as well that needs to be deleted, Skip 2 and do this instead:

find /dir/that/contains/esymac_logEvents.log* | xargs rm -frf

  • check to make sure these are the files indeed that you would like to delete and no other

find /dir/that/contains/esymac_logEvents.log* | xargs ls -l

  • Once you verify the first step, execute this command

find /dir/that/contains/esymac_logEvents.log* | xargs rm -f

Since you want to keep all files that differ from the format mentioned, do:

  1. Execute this. This will populate FilesToDelete.txt with files/dir to be deleted. Review this to make sure that files listed in are indeed the files you intend to delete.

find /path/to/dir/esymac_logEvents.log* | xargs ls -l > FilesToDelete.txt

  1. Once you verify the Step-1, do

find /path/to/dir/esymac_logEvents.log* -type f | xargs rm -f

  1. If directories are involved as well that needs to be deleted, Skip 2 and do this instead:

find /dir/that/contains/esymac_logEvents.log* | xargs rm -rf

Source Link

  • check to make sure these are the files indeed that you would like to delete and no other

find /dir/that/contains/esymac_logEvents.log* | xargs ls -l

  • Once you verify the first step, execute this command

find /dir/that/contains/esymac_logEvents.log* | xargs rm -f