Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Deleting the same named file located in multiple directories in a LAMP Server

Posted on 2006-07-24
1
Medium Priority
?
257 Views
Last Modified: 2010-04-20
Good Afternoon,

I have a single file that shows up in multiple subdirectories off of the home directory on a LAMP server. The file is called wedo.php. There are possibly 300 of them in various directories under home and I need to delete them all. Is there a way to do a mass located and then a mass delete?

I am in a bit of hurry for this so any help you can give would be appreciated.

0
Comment
Question by:safepointmedia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 22

Accepted Solution

by:
pjedmond earned 2000 total points
ID: 17170113
******STOP*******

I forgot to change the file name!!!! Obviously make a backup before doing!

Correct scripts are:


find /var/www/ | grep "wedo\.php$" | awk {'print "rm " $1 '} | /bin/bash

Will do it.

To test without running the command:

find /var/www/ | grep "wedo\.php$" | awk {'print "rm " $1 '}

(   (()
(`-' _\
 ''  ''

0

Featured Post

Create CentOS 7 Newton Packstack Running Keystone

A bug was filed against RDO for the installation of Keystone v3. This guide is designed to walk you through the configuration for using Keystone v3 with Packstack. You will accomplish this using various repos and the Answers file.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Fine Tune your automatic Updates for Ubuntu / Debian
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question