Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-18-2011, 05:22 PM   #1
LQ Newbie
Registered: Apr 2011
Location: Brooklyn NYC
Distribution: Redhat & CentOS
Posts: 23

Rep: Reputation: 6
Finding Muti Files

Ok, so I work with this travel company that host sites for different agents. They have ALL the sites in one directory and each site has its own search.php file. How can I locate, and change all the search.php files permissions to 644 in one shot? Is this possible maybe with the find command? I read the man page for this but I am not sure how to write out the command. Thanks in advanced for the help everyone!
Old 04-18-2011, 05:35 PM   #2
LQ Newbie
Registered: Sep 2007
Posts: 6

Rep: Reputation: 2
the find command will work for you in conjunction with the chmod command
cd to the directory that they all live under then run
find ./ -name search.php -exec chmod 644 {} \;
explaining this
find {directory to search} -name {name of file/files to search for} -exec {command to run} {} \;
the \; tells the -exec option that that is the end of that command
the {} is the file/files that find finds

Last edited by jeff_sadowski; 04-18-2011 at 05:39 PM.
1 members found this post helpful.
Old 04-18-2011, 05:36 PM   #3
Registered: Apr 2007
Location: USA
Distribution: Kubuntu 8.04
Posts: 579
Blog Entries: 8

Rep: Reputation: 148Reputation: 148
I'd use something like this.

find -name 'FILENAME' -exec chmod -v 644 '{}' \;
The -v option to chmod will cause it to report each file it executes on.
Old 04-19-2011, 09:50 AM   #4
LQ Newbie
Registered: Apr 2011
Location: Brooklyn NYC
Distribution: Redhat & CentOS
Posts: 23

Original Poster
Rep: Reputation: 6
Thanks! Those commands did the job! Thank you for your help and explanations! I better understand the find command with those options now!


chmod, find, permissions

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP with muti-boot of windows 7 and fedora 13 akmafia001 Linux - Newbie 5 09-23-2010 06:45 PM
muti sound card linux ninja master Linux - Hardware 2 02-02-2009 04:02 AM
Finding files and then finding content within those files... Maeltor Linux - Software 5 03-13-2007 01:06 PM
Stacks in Muti-threaded program arunka Linux - General 1 06-08-2006 02:20 AM
question?, X + muti monitors + multi compuers over network SciYro Linux - General 2 06-16-2005 10:26 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:30 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration