PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, March 15, 2022

[FIXED] Delete large batch of files with same file name in different directories - cpanel/LAMP

 March 15, 2022     cpanel, lamp, putty     No comments   

Issue

I have a bunch of old deprecated pages on a site i am working in.

Let's say the site has different product pages: site.com/product1 site.com/product2 site.com/product3 ...... site.com/product450

Inside each of these directories is a page called productreveiw.php

Due to a bad initial design, this page existed in every directory. Long ago, this was pointed to a single product review page (site.com/productreview.php).

Everything works great, but there are 450 of these old files out there, one in each directory.

I want to delete them out without going into each directory in ftp and manually deleting them.

Is there a way to do this in cpanel->file manager? I was able to search and find them all, but I could take no action after that, except opening the directory they are in. I was hoping to be able to select all and delete them in 1 shot.

I'm sure there is a way to do this in SSH, but I'm not real comfortable in there and was hoping for a more user friendly route through cpanel or ftp.

Thanks in advance as always.


Solution

There were no takers on this question.

I ended up deleting everything through SSH, which wasn't that hard after I got used to it.

I searched for files like this:

find . -name "index1.php" -delete



Answered By - Kevin
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing