Find the answer to your Linux question:
Results 1 to 6 of 6
Hi, I'm a newbie with servers and I wondered if you could change the user and group of all files in a folder because at the minute half of them ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2011
    Posts
    3

    Change user and group of all files in a folder?


    Hi, I'm a newbie with servers and I wondered if you could change the user and group of all files in a folder because at the minute half of them are owned by ftp user and half by apache.

    I've resized 300 image files and need to copy them back over.

    I suppose I could delete them all in plesk file manager then re-upload them all, nothing could go wrong doing it that way could it?

  2. #2
    Just Joined! hunter_thom's Avatar
    Join Date
    Apr 2010
    Posts
    89
    Code:
    chown -R user:group /path/
    will recursively change ownership.

    Code:
    chown user:group /path/*
    will not recursively change ownership but will change ownership by directory.

    You could also do something like this, perhaps all .conf or all .html or all .zip etc:
    Code:
    chown user:group /path/*.conf

  3. #3
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    3,043
    man chown and pick the options you want, you need root rights so either su to root or sudo chown user_who_should_own_files:group_owner_of_files
    you may also want to check chmod as depending on who created the files you may want to change access rights for owner/group/other

  4. #4
    Just Joined!
    Join Date
    Oct 2011
    Posts
    3
    Thanks for the quick reply.

    My next newbie question is how do i access the command line?
    Do i need to install something on the server?
    Do i need to install OpenSSH on my windows comp?

    At the minute i can only access the server [Linux 2.6.18] through Plesk 9 and FTP.

  5. #5
    Just Joined!
    Join Date
    Oct 2011
    Posts
    22
    Have you a ssh access to your server?

  6. #6
    Just Joined!
    Join Date
    Oct 2011
    Posts
    3
    Yes i think the server can be accessed through ssh but i'm not 100% sure, i've downloaded Putty but havn't set it up yet, still reading the instructions on how to use it.

Posting Permissions

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