|
|
|
||||
|
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
Confirmed User
Join Date: Oct 2002
Location: European Union
Posts: 1,752
|
Help with chmod
How do I change filepermission for all .jpg images, folders and subfolders?
I want to change to 0777 for a short period while a script make some changes (some images have different owners) and then back to normal again. After the script is finished I want all folders to be 0755 and all .jpg images to be 0644. |
|
|
|
|
|
#2 |
|
Confirmed User
Join Date: Apr 2002
Location: /root/
Posts: 4,997
|
Code:
find /path/to/dir -name "*.jpg" -or -type d -print|xargs chmod 777 Code:
find /path/to/dir -name "*.jpg" -print|xargs chmod 0644 find /path/to/dor -type d -print |xargs chmod 0755 |
|
|
|
|
|
#3 |
|
Confirmed User
Join Date: Oct 2002
Location: European Union
Posts: 1,752
|
Thanks,
Never seen it like this before. Can you explain how it's working? |
|
|
|
|
|
#4 | |
|
Confirmed User
Join Date: Apr 2002
Location: /root/
Posts: 4,997
|
Quote:
Code:
chmod -R 777 /path/to/dir To reverse it you can't run a recursive chmod because you need different chmod for files and directories Code:
find /path/to/dir -name "*.jpg" -print xargs executes "chmod 0644" for each image |
|
|
|
|