Find the answer to your Linux question:
Results 1 to 3 of 3
I just upgraded my vps to use suPHP and I read somewhere that a file cannot have more than 755 set to it. I would like to write a script ...
  1. #1
    Just Joined!
    Join Date
    May 2007
    Posts
    24

    Need help with a script please.

    I just upgraded my vps to use suPHP and I read somewhere that a file cannot have more than 755 set to it.

    I would like to write a script that will (recursively) check each directory within a users /home/username/public_html directory and change all the permissions of any files that are currently 777 to 755.

    Can anyone please tell me how to do this?

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    find should suffice:

    Code:
    find . -perm -777 -exec echo chmod 755 '{}' \;
    This will echo the list of generated commands. If you agree with it, just remove the "echo" to actually run them and apply the changes.

  3. #3
    Just Joined!
    Join Date
    May 2007
    Posts
    24
    Awesome... Thanks.

    This same question was on another popular linux forum and was there for the last 3 or 4 hours with no response. You answered in 8 minutes

    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...