Latest web development tutorials

Linux chown command

Linux chown command

Linux command Daquan Linux command Daquan

Linux / Unix is ​​more than multi-operating system, all files Jie owner. The use chown owner of the specified file to a specified user or group of users can be a user name or user ID; group can be a group name or group ID; file is a space-separated list of files to change permissions, support wildcards. .

Generally, this command is only used by a system administrator (root), end users do not have permission to change someone else's file owner, and also do not have permission to change the owner of your own files to others. Only the system administrator (root) have permission to do so.

Permissions: root

grammar

chmod [-cfhvR] [--help] [--version] user[:group] file...

Parameters:

  • user: new file owner user ID
  • group: new file owner's user group (group)
  • -c: If the file owner really has changed, it shows the change action
  • -f: If the owner of the file can not be changed and do not display an error message
  • -h: Only the link (link) to make changes, rather than the link really points to a file
  • -v: Display owner details change
  • -R: All the files and subdirectories under the current directory will be the same as the owner of the change (that is handed back, one by one change)
  • --help: Display HELP
  • --version: display version

Examples

The owner of the file file1.txt jessie users to user groups:

chown jessie:users file1.txt

The current directory of all the files and subdirectories owned by key lamport users to user groups:

chmod -R lamport:users *

Linux command Daquan Linux command Daquan