Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
+ Reply to Thread
Results 1 to 7 of 7

This is a discussion on ssh help in the VPS & Dedicated forum
Hallo I have just transfered my files for my old shared hosting provider using the wget ftp command in ssh. now each file has the ...

  1. #1
    JPC Member
    Join Date
    Jun 2007
    Posts
    1

    ssh help

    Hallo

    I have just transfered my files for my old shared hosting provider using the wget ftp command in ssh. now each file has the owner root, i can change each one, one by one, but with 14k would take ages.

    I can remember using a ssh command that changes each file, but i carnt remember the command or find it on the internet

    can anyone help

    thanks

  2. #2
    Loyal Client thisisit3's Avatar
    Join Date
    Mar 2007
    Posts
    631
    Code:
    chown -R user:group *
    -R means to recurse into all directories and subdirectories, the user name and group name are separated by a ":" and the * means everything.

    i believe the above may skip files/dirs in the current directory which start with a dot, like ".htaccess", so you might run the same command a second time like:

    Code:
    chown user:group ".*"
    (don't use -R otherwise you'll end up recursing downwards out of the current dir)

    You may also use "find", like:

    Code:
    for files only:
    
    find . -iname "*" -type f | xargs chown user:group
    
    for directories only:
    
    find . -iname "*" -type d | xargs chown user:group

  3. #3
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    5,985
    You would want to use
    Code:
    chown -R owner:group /path/of/files/to/change
    Note that the -R option is capitalized and it is case-sensitive.

    Change owner and group with the user name and group name to which you want to change ownership and the /path/of/files... to the actual path.

    Good luck.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  4. #4
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    5,985
    D'oh thisisit3 beat me to the answer.
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  5. #5

  6. #6
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,748
    Quote Originally Posted by thisisit3 View Post
    whoz da man? whoz da man!
    You rang?!?!
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  7. #7

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