Solved

how to do a find and exec chmod

Posted on 2009-04-01
2
437 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 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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.

739 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