• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

chown Command Examples in Linux

by admin

The chown command is used to change the owner, the group, or both for a file or directory. At times, you may wish for someone else to manage an object’s permissions other than the user who created that object. You can combine the chown command with the -R option to recursively change ownership through a directory structure.

Syntax

chown command can be used in various ways as shown below:

1. Change owner:

# chown {user name} {file/directory name}

2. Change owner and group:

# chown {user name}:{group name} {file/directory name}

3. Change owner and change group to specified user’s login group:

# chown {user name}: {file/directory name}

4. Change group:

# chown {user name} {file/directory name}

chown Command Examples

1. To change the owner of the file:

# chown mike file.txt 

2. To see if the changes have taken place or not:

# chown -c mike file.txt 

3. To suppress if any error messages:

# chown -f mike file.txt 

4. To apply the changes recursively:

# chown -R mike /mydir 

5. To change the file owner and group at once:

# chown mike:SUPPORT file.txt 

Filed Under: Linux

Some more articles you might also be interested in …

  1. less Command Examples
  2. lvextend: command not found
  3. fish: The Friendly Interactive SHell, a command-line interpreter designed to be user friendly
  4. smbget Command Examples in Linux
  5. flite: Speech synthesis engine
  6. matlab Command Examples
  7. f3probe: Probe a block device (e.g. a flash drive or a microSD card) for counterfeit flash memory
  8. userdel: command not found
  9. binwalk: command not found
  10. archlinux-java Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright