?
Solved

how to do a find and exec chmod

Posted on 2009-04-01
2
Medium Priority
?
443 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
[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
  • 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.
Suggested Courses
Course of the Month15 days, 8 hours left to enroll

743 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