Results 1 to 4 of 4

Thread: changing permission on specific multiple files/directories

  1. #1
    Join Date
    Feb 2013
    Beans
    27

    changing permission on specific multiple files/directories

    I can't seem to figure out how finish off the last command

    Code:
     ls -p testfiles/ | more | grep "^d" | chmod 700
    I want to change the permission on all the files/directories that start with a d to 700. I just don't know what to write after chmod 700. I expect chmod to already know the files because it's streamed to it.

    Thanks

  2. #2
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: changing permission on specific multiple files/directories

    How about...
    Code:
    find testfiles -type d -exec chmod 700 {} \;
    Cheesemill

  3. #3
    Join Date
    Dec 2007
    Beans
    225
    Distro
    Kubuntu 11.04 Natty Narwhal

    Re: changing permission on specific multiple files/directories

    Quote Originally Posted by Cheesemill View Post
    How about...
    Code:
    find testfiles -type d -exec chmod 700 {} \;
    No. I think your command will change directories to 700 rather than files that start with d.

    What you want is something like this:
    Code:
    find /path/to/testfiles -name "d*" -exec chmod 700 {} \;

  4. #4
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: changing permission on specific multiple files/directories

    Your absolutely correct, I misread the OP.
    Cheesemill

Tags for this Thread

Bookmarks

Posting Permissions

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