Chown

Chown

The chown command is used on Unix-like systems to change the owner of a file. In most implementations, it can only be executed by the Superuser. Unprivileged (regular) users who wish to change the group of a file that they own may use chgrp.

Usage

The general syntax for the chown command is:

chown [-R] "user" [:"group"] "target1" "target2" ..
* The optional "user" parameter indicates the new user who should take ownership of the targets.
* The optional "group" parameter (which must be prefixed with a colon, :) indicates the group with which the targets should be associated.
* The "target" parameters indicate the files or directories for which the user and/or group will be changed.
* A widely supported option is -R which specifies a recursive change for any named target directory and files within.

Footnotes

* One of either "user" or "group" must be specified. The chown command will not execute properly without at least one of those parameters.
* The "user" and "group" parameters can be either symbolic names or identifiers (i.e. a User ID or Group ID).

Usage examples

* Note, these commands must be run as root

$ chown root /var/run/httpd.pid
* Change the owner of /var/run/httpd.pid to 'root' (the standard name for the Superuser).

$ chown rob:developers strace.log
* Change the owner of strace.log to 'rob' and the group identifier to 'developers'.

$ chown nobody:nobody /tmp /var/tmp
* Change the owner of /tmp and /var/tmp to ‘nobody’ (not a good idea)
* Change the group associated with the same targets to the group ‘nobody’ (conventionally the ‘nobody’ user's group)

$ chown :512 /home
* Change the group identifier of /home to 512 (regardless of whether a group name is associated with the identifier 512 or not).

$ chown -R us base
* Change the ownership of base to the user us and make it recursive (-R)

ee also

* chmod
* chgrp

External links

* [http://nersp.nerdc.ufl.edu/~dicke3/nerspcs/chown.html chown manual page]
* [http://www.linfo.org/chown.html The chown Command] by The Linux Information Project (LINFO)


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Chown — bezeichnet: Chown (Unix), ein Kommandozeilenprogramm unter Unix Chown ist der Familienname folgender Personen: Bruce Chown (1893–1986), kanadischer Wissenschaftler, Offizier des Order of Canada Eric Chown, Informatiker, Professor am Bowdoin… …   Deutsch Wikipedia

  • Chown — UNIX‐утилита, изменяющая владельца и/или группу для указанных файлов. В качестве имени владельца/группы берётся первый аргумент, не являющийся опцией. Если задано только имя пользователя (или числовой идентификатор пользователя), то данный… …   Википедия

  • chown — chown (от англ. change owner) UNIX‐утилита, изменяющая владельца и/или группу для указанных файлов. В качестве имени владельца/группы берётся первый аргумент, не являющийся опцией. Если задано только имя пользователя (или числовой… …   Википедия

  • Chown — Saltar a navegación, búsqueda La instrucción chown permite cambiar el propietario del fichero en sistemas tipo UNIX. Cada fichero de Unix tiene un propietario y un grupo, que se corresponden con el usuario y el grupo de quien lo creó. El usuario… …   Wikipedia Español

  • Chown — Capture d écran de la page de manuel en anglais de la commande chown La commande chown est utilisée dans les systèmes de type UNIX pour changer le propriétaire d un fichier ou dossier (De l anglais change the owner). Dans la plupart de ses… …   Wikipédia en Français

  • chown — For the surname, see Chown (surname). The chown command (abbreviation for change owner) is used on Unix like systems to change the owner of a file. In most implementations, it can only be executed by the superuser. Unprivileged (regular) users… …   Wikipedia

  • chown — La instrucción chown permite cambiar el propietario del fichero en sistemas tipo UNIX. Puede especificarse tanto el nombre de un usuario, así como un número de identidad de usuario (UID) y el nombre de grupo o (GID) numérico del grupo.… …   Wikipedia Español

  • chown — Capture d écran de la page de manuel en anglais de la commande chown chown est un appel système et une commande UNIX pour changer le propriétaire d un fichier ou dossier (de l anglais change the owner). Traditionnellement, les Unix « System… …   Wikipédia en Français

  • Chown — Cada fichero de Unix tiene un propietario y un grupo, que se corresponden con el usuario y el grupo de quien lo creó. La instrucción chown permite cambiar el propietario del fichero. El usuario root puede cambiar a cualquier fichero el… …   Enciclopedia Universal

  • Chown — This unusual surname is derived from the Olde English pre 7th Century personal name Chun, (of uncertain origin). It is recorded as a personal name in the Hundred Rolls of Cambridgeshire in 1273, as Chun Pimme and Chun Pistor, although… …   Surnames reference

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”