Solved

how to do a find and exec chmod

Posted on 2009-04-01
2
432 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
Comment Utility
find /home/unitnet -name index.jsp -exec chown apache:apache {} \;
0
 
LVL 23

Accepted Solution

by:
Maciej S earned 500 total points
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
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.

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now