|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
||||
|
||||
|
CHMOD all files
How would I CHMOD all files with a .pl extension to 755 in my cgi-bin directory (and its subdirectories)? I know how to CHMOD one file, but not recursively on an extension. Thanks for the help.
|
|
#2
|
||||
|
||||
|
I would have thought the following would work:
chmod -R 755 *.pl |
|
#3
|
||||
|
||||
|
Seems to only work for the current directory. It doesn't go to the subdirectories.
|
|
#4
|
||||
|
||||
|
Hrm, you're right, I tried a few things and couldn't get it to work. You could write a shell or perl script to recurse through the directories and execute the chmod command for you.
|
|
#5
|
||||
|
||||
|
I've seen it done straight from the command line because I saw my DBA do it once before. I don't know how to write a shell script and I don't know how to recurse through directories in Perl.
|
|
#6
|
|||
|
|||
|
Try this:
1) In current working directory: Code:
find . -type f -name "*\.pl" | xargs chmod 755 2) Or specify the root dir: Code:
find /path/to/that/dir -type f -name "*\.pl" | xargs chmod 755 |
|
#7
|
||||
|
||||
|
Great! It worked. Thanks.
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Linux Help > CHMOD all files |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|