Solved

how to do a find and exec chmod

Posted on 2009-04-01
2
434 Views
Last Modified: 2012-05-06
Hello,

I have a bunch of index.jsp that need to change the ownership from root:root to apache:apache

i can find them by
#find /home/unitnet -name "index.jsp" -exec ls -sl {} \; | grep root

looking for a way to change the owner and group to apache

thanks
Randy
0
Comment
Question by:paries
  • 2
2 Comments
 
LVL 23

Expert Comment

by:Maciej S
ID: 24044645
find /home/unitnet -name index.jsp -exec chown apache:apache {} \;
0
 
LVL 23

Accepted Solution

by:
Maciej S earned 500 total points
ID: 24044658
It will change all index.jsp files of course. If you want to change only files which belong to root:root, then use below command:
find /home/unitnet -name index.jsp -user root -group root -exec chown apache:apache {} \;
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
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.

785 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