Results 1 to 3 of 3

Thread: change the owner of an entire dir with files and subdirectories

  1. #1
    Join Date
    Oct 2006
    Beans
    85

    change the owner of an entire dir with files and subdirectories

    hi, I had unzipped an file that using the root account, the unzipped result was a main directory that has several files and subdirs, i waht to change the owner to my user account, i use this comand:

    chown user.user /dir

    but it only change the owner of the directory but the content it always belongs to the root, my question is:

    what parameter should I use to change the owner of all objects inside that dir?

    regards

  2. #2
    Join Date
    Jun 2011
    Location
    Las Vegas
    Beans
    Hidden!
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: change the owner of an entire dir with files and subdirectories

    use:
    chown -R user:user /dir

  3. #3
    Join Date
    Apr 2008
    Location
    Australian in Germany
    Beans
    4,010
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: change the owner of an entire dir with files and subdirectories

    Some more info, a bit more general:

    You can find things like options for commands by looking at the man page. In this case
    Code:
    man chown

    For people who are looking for a way to do this from the GUI, you can start an instance of the file manager, Nautilus, using gksudo

    Code:
    gksudo nautilus
    This instance will have root privileges, and will allow you to change permissions of root owned directories and files by right clicking and going to "preferences" on the permissions tab. Be careful using Nautilus like this. It will also allow you to completely break your system if you do the wrong thing with it.
    Michael

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
  •