Wazaterm » Linux Commands » chown

How to use chown Linux command

The chown command changes the user and/or group ownership of each given file.

Usage

Change the owner of the file, foo.txt, to root

    
      $ chmod root foo.txt
    
  

Change the owner of the file, foo.txt, to root and the group owner to sudousers

    
      $ chmod root:sudousers foo.txt
    
  

Change the owner of the files to root against files under the directory, linux, recursively

    
      $ chown -R root linux/