Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2005
    Posts
    268

    CHMOD for files?

    Hi guys,

    Sorry for the newbies question, I just moved my folder_A from computer A to computer B, what is the command to change the permission of owner, access, group for every files in that folder_A at 1 time ? Thanks first.

    jacobs.

    note: in the folder_A has hundred of files.
    Let's say , i want to change owner = laptop, access = read and write, group = user, access = read and write , what is the specific command to do that for all the files in folder_A at 1 time ? thanks again
    Last edited by AndyJ; 06-18-2007 at 06:39 PM.

  2. #2
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    9,072
    Change ownership:

    chown -R user:group folder_A

    Change permission:

    chmod -R 644 folder_A

    The 644 is just an example, so you will probably want to change that to the correct number. Also, since this is recursive (-R) use with extreme caution.
    RACK911 Labs | Penetration Testing | https://www.RACK911Labs.ca

    www.HostingSecList.com - Security Notices for the Hosting Community.

  3. #3
    Join Date
    Jan 2005
    Posts
    268
    Quote Originally Posted by Pat H View Post
    Change ownership:

    chown -R user:group folder_A

    Change permission:

    chmod -R 644 folder_A

    The 644 is just an example, so you will probably want to change that to the correct number. Also, since this is recursive (-R) use with extreme caution.
    is that for all the file in folder_A ? or just folder_A?

    I need to change permission for the files in folder_A, not folder_A, by the way, thanks for the output.

  4. #4
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    9,072
    Ah, if you want to change ALL of the files within the folder:

    cd folder_A
    chown -R user:group *
    chmod -R 644 *

    Just make sure you are in the folder_A directory first.
    RACK911 Labs | Penetration Testing | https://www.RACK911Labs.ca

    www.HostingSecList.com - Security Notices for the Hosting Community.

  5. #5
    Join Date
    Jan 2005
    Posts
    268
    by the way, what is user and group in here ?

  6. #6
    [quota]want to change owner = laptop, access = read and write, group = user, access = read and write ,[/quota]

    Then you need
    cd folder_A
    chown -R laptop:user *
    chmod -R 644 *

Posting Permissions

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