0

I want to find and delete all the "similar files as shown below" recursively from the specified directory of my Linux Server by Using COMMAND LINE....

"file.php?p=10&file=load%2Fnew Animations 1%2FAwesome_flowers-(text1).gif&sort=0"

"file.php?p=10&file=load%2Fnew Games 1%2FAwesome_flowers_-(text1).gif&sort=1"

Note: All these files have different file sizes and The matched text in all files is "file.php?p***"

3
  • belongs to unix.stackexchange.com
    – Raptor
    Commented Jul 25, 2013 at 6:03
  • rm -f file.php\?p\=*
    – devnull
    Commented Jul 25, 2013 at 6:03
  • does it work for "recursively" file deletion???? I want to delete all files within a directory which have subdirectories too and i want to delete files from subdirectories too I am sorry for my Bad English...
    – A.A
    Commented Jul 25, 2013 at 6:22

1 Answer 1

1

This should help you to delete files recursively..

find /path/to/dir -type f -name 'file.php\?p*' -exec rm -i {} \;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.