4 Revīzijas 92cb70605c ... bf75423b37

Autors SHA1 Ziņojums Datums
  Riley Baird bf75423b37 Added manpage for uname-obsd.c 9 gadi atpakaļ
  alimiracle 40a31d5321 new clean 9 gadi atpakaļ
  alimiracle 6362ea6971 new clean 9 gadi atpakaļ
  alimiracle b52cd920b4 make new gnu config files 9 gadi atpakaļ

+ 188 - 0
src/bin/cat/cat.1

@@ -0,0 +1,188 @@
+.\"	$OpenBSD: cat.1,v 1.34 2015/01/15 19:06:31 schwarze Exp $
+.\"	$NetBSD: cat.1,v 1.12 1995/09/27 05:38:55 cgd Exp $
+.\"
+.\" Copyright (c) 1989, 1990, 1993
+.\"	The Regents of the University of California.  All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" the Institute of Electrical and Electronics Engineers, Inc.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"     @(#)cat.1	8.3 (Berkeley) 5/2/95
+.\"
+.Dd $Mdocdate: January 15 2015 $
+.Dt CAT 1
+.Os
+.Sh NAME
+.Nm cat
+.Nd concatenate and print files
+.Sh SYNOPSIS
+.Nm cat
+.Op Fl benstuv
+.Op Ar
+.Sh DESCRIPTION
+The
+.Nm
+utility reads files sequentially, writing them to the standard output.
+The
+.Ar file
+operands are processed in command-line order.
+If
+.Ar file
+is a single dash
+.Pq Sq -
+or absent,
+.Nm
+reads from the standard input.
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl b
+Implies the
+.Fl n
+option but doesn't count blank lines.
+.It Fl e
+Implies the
+.Fl v
+option and also prints a dollar sign
+.Pq Ql \&$
+at the end of each line.
+.It Fl n
+Number the output lines, starting at 1.
+.It Fl s
+Squeeze multiple adjacent empty lines, causing the output to be
+single spaced.
+.It Fl t
+Implies the
+.Fl v
+option and also prints tab characters as
+.Ql ^I .
+.It Fl u
+The output is guaranteed to be unbuffered (see
+.Xr setbuf 3 ) .
+.It Fl v
+Displays non-printing characters so they are visible.
+Control characters print as
+.Ql ^X
+for control-X, with the exception of the tab and EOL characters,
+which are displayed normally.
+The tab character, control-I, can be made visible via the
+.Fl t
+option.
+The DEL character (octal 0177) prints as
+.Ql ^? .
+Non-ASCII characters (with the high bit set) are printed as
+.Ql M-
+(for meta) followed by the character for the low 7 bits.
+.El
+.Sh EXIT STATUS
+.Ex -std cat
+.Sh EXAMPLES
+Print the contents of
+.Ar file1
+to the standard output:
+.Pp
+.Dl $ cat file1
+.Pp
+Sequentially print the contents of
+.Ar file1
+and
+.Ar file2
+to the file
+.Ar file3 ,
+truncating
+.Ar file3
+if it already exists.
+See the manual page for your shell (e.g.,
+.Xr sh 1 )
+for more information on redirection.
+.Pp
+.Dl $ cat file1 file2 > file3
+.Pp
+Print the contents of
+.Ar file1 ,
+print data it receives from the standard input until it receives an
+.Dv EOF
+.Pq Sq ^D
+character, print the contents of
+.Ar file2 ,
+read and output contents of the standard input again, then finally output
+the contents of
+.Ar file3 .
+Note that if the standard input referred to a file, the second dash
+on the command line would have no effect, since the entire contents of the file
+would have already been read and printed by
+.Nm
+when it encountered the first
+.Ql \&-
+operand.
+.Pp
+.Dl $ cat file1 - file2 - file3
+.Sh SEE ALSO
+.Xr head 1 ,
+.Xr less 1 ,
+.Xr more 1 ,
+.Xr pr 1 ,
+.Xr sh 1 ,
+.Xr tail 1 ,
+.Xr vis 1 ,
+.Xr setbuf 3
+.Rs
+.%A Rob Pike
+.%T "UNIX Style, or cat -v Considered Harmful"
+.%J "USENIX Summer Conference Proceedings"
+.%D 1983
+.Re
+.Sh STANDARDS
+The
+.Nm
+utility is compliant with the
+.St -p1003.1-2008
+specification.
+.Pp
+The flags
+.Op Fl benstv
+are extensions to that specification.
+.Sh HISTORY
+A
+.Nm
+utility appeared in
+.At v1 .
+.Sh CAVEATS
+Because of the shell language mechanism used to perform output
+redirection, the following command will cause the original data in
+.Ar file1
+to be destroyed:
+.Pp
+.Dl $ cat file1 file2 > file1
+.Pp
+To append
+.Ar file2
+to
+.Ar file1 ,
+instead use:
+.Pp
+.Dl $ cat file2 >> file1

+ 249 - 0
src/bin/chio/chio.1

@@ -0,0 +1,249 @@
+.\"	$OpenBSD: chio.1,v 1.33 2015/01/15 19:06:31 schwarze Exp $
+.\"	$NetBSD: chio.1,v 1.1.1.1 1996/04/03 00:34:38 thorpej Exp $
+.\"
+.\" Copyright (c) 1996 Jason R. Thorpe <thorpej@and.com>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgments:
+.\"	This product includes software developed by Jason R. Thorpe
+.\"	for And Communications, http://www.and.com/
+.\" 4. The name of the author may not be used to endorse or promote products
+.\"    derived from this software without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.Dd $Mdocdate: January 15 2015 $
+.Dt CHIO 1
+.Os
+.Sh NAME
+.Nm chio
+.Nd medium changer control utility
+.Sh SYNOPSIS
+.Nm chio
+.Op Fl f Ar changer
+.Ar command
+.Op Ar arg ...
+.Sh DESCRIPTION
+The
+.Nm
+utility is used to control the operation of medium changers, such as those
+found in tape and optical disk jukeboxes.
+.Pp
+The options are as follows:
+.Bl -tag -width 10n
+.It Fl f Ar changer
+Use the device
+.Ar changer
+rather than the default device
+.Pa /dev/ch0 .
+.El
+.Pp
+A medium changer apparatus is made up of
+.Em elements .
+There are five element types:
+.Em picker
+(medium transport),
+.Em slot
+(storage),
+.Em portal
+(import/export),
+.Em drive
+(data transfer), and
+.Em voltag
+(select by volume identifier).
+The
+.Em voltag
+pseudo-element type allows the selection of tapes by their volume code,
+which is typically a barcode on the tape.
+In this command description, the shorthand
+.Sq ET
+will be used to represent an element type, and
+.Sq EU
+will be used to represent an element unit.
+For example, to represent
+the first robotic arm in the changer, the ET would be
+.Dq picker
+and the EU would be
+.Dq 0 .
+.Pp
+The following commands are supported:
+.Bl -tag -width Ds
+.It Xo
+.Cm exchange
+.Ar src-ET src-EU dst1-ET dst1-EU
+.Op Ar dst2-ET dst2-EU
+.Op Cm inv1
+.Op Cm inv2
+.Xc
+Performs a media unit exchange operation.
+The media unit in
+.Ar src-ET Ns / Ns Ar src-EU
+is moved to
+.Ar dst1-ET Ns / Ns Ar dst1-EU
+and the media unit previously in
+.Ar dst1-ET Ns / Ns Ar dst1-EU
+is moved to
+.Ar dst2-ET Ns / Ns Ar dst2-EU .
+In the case of a simple exchange,
+.Ar dst2-ET Ns / Ns Ar dst2-EU
+is omitted and the values
+.Ar src-ET Ns / Ns Ar src-EU
+are used in their place.
+The optional modifiers
+.Cm inv1
+and
+.Cm inv2
+specify whether the media units are to be inverted before insertion into
+.Ar dst1-ET Ns / Ns Ar dst2-EU
+and
+.Ar dst2-ET Ns / Ns Ar dst2-EU
+respectively.
+.Pp
+Note that not all medium changers support the
+.Cm exchange
+operation; the changer must have multiple free pickers or emulate
+multiple free pickers with transient storage.
+.It Cm getpicker
+Report which picker unit the changer is currently configured to use.
+.It Xo
+.Cm move
+.Ar from-ET from-EU to-ET to-EU
+.Op Cm inv
+.Xc
+Moves the media unit from
+.Ar from-ET Ns / Ns Ar from-EU
+to
+.Ar to-ET Ns / Ns Ar to-EU .
+If the optional modifier
+.Cm inv
+is specified, the media unit will be inverted before insertion.
+If
+.Em from-ET
+is a drive,
+.Nm
+will first attempt to open and perform an
+.Dv MTOFFL
+operation on the
+.Xr st 4
+device corresponding to
+.Ar from-EU .
+By default, the
+.Xr st 4
+device
+.No /dev/rst Ns Ar X
+is used, where
+.Ar X
+is the
+.Ar from-EU .
+This mapping can be changed by using the
+.Xr chio.conf 5
+file.
+.It Cm params
+Report the number of slots, drives, pickers, and portals in the changer,
+and which picker unit the changer is currently configured to use.
+.It Cm position Ar to-ET to-EU Op Cm inv
+Position the picker in front of the element described by
+.Ar to-ET Ns / Ns Ar to-EU .
+If the optional modifier
+.Cm inv
+is specified, the media unit will be inverted before insertion.
+.Pp
+Note that not all changers behave as expected in response to this command.
+.It Cm setpicker Ar unit
+Configure the changer to use picker
+.Ar unit .
+.It Cm status
+.Op Fl vVa
+.Op Ar ET
+Report the status of all elements in the changer.
+If
+.Ar ET
+is specified, report the status of all elements of type
+.Ar ET .
+.Bl -tag -width Ds
+.It Fl v
+Print the primary volume tag for each loaded medium, if any.
+The volume
+tag is printed as
+.Dq \*(LtLABEL:SERIAL\*(Gt .
+.It Fl V
+Print the alternate volume tag for each loaded medium, if any.
+.It Fl a
+Print all additional information (as in
+.Fl vV ) .
+.El
+.Pp
+The status bits output are defined as follows:
+.Bl -tag -width indent
+.It Dv FULL
+Element contains a media unit.
+.It Dv IMPEXP
+Media was deposited into element by an outside human operator.
+.It Dv EXCEPT
+Element is in an abnormal state.
+.It Dv ACCESS
+Media in this element is accessible by a picker.
+.It Dv EXENAB
+Element supports passing media (exporting) to an outside human operator.
+.It Dv INENAB
+Element supports receiving media (importing) from an outside human operator.
+.El
+.El
+.Sh ENVIRONMENT
+.Bl -tag -width CHANGER
+.It Ev CHANGER
+The default changer may be overridden by setting this environmental
+variable to the desired changer device.
+.El
+.Sh FILES
+.Bl -tag -width "/etc/chio.confXX"
+.It Pa /dev/ch0
+Default changer device.
+.It Pa /etc/chio.conf
+Optional configuration file to set up a non-default mapping between
+.Xr st 4
+devices and changer drives.
+.El
+.Sh EXAMPLES
+Move the media in slot 3 (fourth slot) to drive 0 (first drive):
+.Pp
+.Dl # chio move slot 3 drive 0
+.Pp
+Move the media with volume tag 000007L2 to drive 1 (second drive):
+.Pp
+.Dl # chio move voltag 00007L2 drive 1
+.Pp
+Configure the changer to use picker 2 (third picker) for operations:
+.Pp
+.Dl # chio setpicker 2
+.Sh SEE ALSO
+.Xr mt 1 ,
+.Xr ch 4 ,
+.Xr st 4 ,
+.Xr chio.conf 5
+.Sh AUTHORS
+The
+.Nm
+program and SCSI changer driver were written by
+.An Jason R. Thorpe Aq Mt thorpej@and.com
+for And Communications
+.Pq Lk http://www.and.com/ .

+ 165 - 0
src/bin/chmod/chflags.1

@@ -0,0 +1,165 @@
+.\"	$OpenBSD: chflags.1,v 1.15 2014/12/13 20:59:24 guenther Exp $
+.\"	$NetBSD: chflags.1,v 1.4 1995/08/31 22:50:22 jtc Exp $
+.\"
+.\" Copyright (c) 1989, 1990, 1993, 1994
+.\"	The Regents of the University of California.  All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" the Institute of Electrical and Electronics Engineers, Inc.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"	@(#)chflags.1	8.4 (Berkeley) 5/2/95
+.\"
+.Dd $Mdocdate: December 13 2014 $
+.Dt CHFLAGS 1
+.Os
+.Sh NAME
+.Nm chflags
+.Nd change file flags
+.Sh SYNOPSIS
+.Nm chflags
+.Oo
+.Fl R
+.Op Fl H | L | P
+.Oc
+.Ar flags
+.Ar
+.Sh DESCRIPTION
+The
+.Nm
+utility modifies the file flags of the listed files
+as specified by the
+.Ar flags
+operand.
+The
+.Ar flags
+of a file dictate special restrictions beyond those enforced by its
+mode/permissions.
+Only the superuser can change the user flags on block and
+character devices.
+.Pp
+You can use
+.Ic ls -lo
+to see the flags of existing files.
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl H
+If the
+.Fl R
+option is also specified, symbolic links on the command line are followed.
+Symbolic links encountered in the tree traversal are not followed.
+.It Fl L
+If the
+.Fl R
+option is also specified, all symbolic links are followed.
+.It Fl P
+If the
+.Fl R
+option is also specified, no symbolic links are followed.
+.It Fl R
+Recurse.
+Where
+.Ar file
+is a directory,
+change the flags of the directory and all the files and directories
+in the file hierarchy below it.
+.El
+.Pp
+Flags are a comma separated list of keywords.
+The following keywords are currently defined:
+.Bd -literal -offset indent
+arch	set the archived flag (superuser only)
+nodump	set the nodump flag (owner or superuser only)
+sappnd	set the system append-only flag (superuser only)
+schg	set the system immutable flag (superuser only)
+uappnd	set the user append-only flag (owner or superuser only)
+uchg	set the user immutable flag (owner or superuser only)
+.Ed
+.Pp
+The
+.Dq arch
+flag is for compatibility only,
+and currently has no effect.
+.Pp
+A file with the
+.Dq nodump
+flag set will by default only be backed up by
+.Xr dump 8
+during full backups.
+The
+.Fl h
+option of
+.Xr dump 8
+can be used to alter this.
+.Pp
+An immutable file may not be changed, moved, or deleted.
+An append-only file is immutable except that data may be appended to it.
+.Pp
+The
+superuser-settable
+.Dq sappnd
+and
+.Dq schg
+flags can be set at any time, but may only be cleared when the system is
+running at security level 0 or \-1
+(insecure or permanently insecure mode, respectively).
+For more information on setting the system security level,
+see
+.Xr securelevel 7 .
+.Pp
+Putting the letters
+.Dq no
+before a flag name causes the flag to be turned off.
+For example:
+.Pp
+.Dl nouchg	the immutable bit should be cleared
+.Pp
+The
+.Fl H ,
+.Fl L ,
+and
+.Fl P
+options are ignored unless the
+.Fl R
+option is specified.
+In addition, these options override each other and the
+command's actions are determined by the last one specified.
+.Sh EXIT STATUS
+.Ex -std chflags
+.Sh SEE ALSO
+.Xr ls 1 ,
+.Xr chflags 2 ,
+.Xr stat 2 ,
+.Xr fts 3 ,
+.Xr securelevel 7 ,
+.Xr symlink 7 ,
+.Xr dump 8
+.Sh HISTORY
+The
+.Nm
+command first appeared in
+.Bx 4.4 .

+ 139 - 0
src/bin/chmod/chgrp.1

@@ -0,0 +1,139 @@
+.\"	$OpenBSD: chgrp.1,v 1.16 2014/01/21 22:35:44 jmc Exp $
+.\"
+.\" Copyright (c) 1983, 1990, 1993, 1994
+.\"	The Regents of the University of California.  All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" the Institute of Electrical and Electronics Engineers, Inc.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"     from: @(#)chgrp.1	8.3 (Berkeley) 3/31/94
+.\"
+.Dd $Mdocdate: January 21 2014 $
+.Dt CHGRP 1
+.Os
+.Sh NAME
+.Nm chgrp
+.Nd change group
+.Sh SYNOPSIS
+.Nm chgrp
+.Op Fl h
+.Oo
+.Fl R
+.Op Fl H | L | P
+.Oc
+.Ar group
+.Ar
+.Sh DESCRIPTION
+.Nm
+sets the group ID of the specified files.
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl H
+If the
+.Fl R
+option is specified, symbolic links on the command line are followed.
+Symbolic links encountered in the tree traversal are not followed.
+.It Fl h
+Change the group ID of the specified symbolic link.
+The
+.Fl h
+and
+.Fl R
+options are mutually exclusive.
+.It Fl L
+If the
+.Fl R
+option is specified, all symbolic links are followed.
+.It Fl P
+If the
+.Fl R
+option is specified, no symbolic links are followed.
+.It Fl R
+Recurse.
+Where
+.Ar file
+is a directory,
+change the group ID of the directory and all the files and directories
+in the file hierarchy below it.
+.El
+.Pp
+The
+.Fl H ,
+.Fl L ,
+and
+.Fl P
+options are ignored unless the
+.Fl R
+option is specified;
+if none of them are given,
+the default is to not follow symbolic links.
+In addition, these options override each other and the
+command's actions are determined by the last one specified.
+.Pp
+The
+.Ar group
+operand can be either a group name from the group database,
+or a numeric group ID.
+If a group name is also a numeric group ID, the operand is used as a
+group name.
+.Pp
+By default,
+.Nm
+clears the set-user-ID and set-group-ID bits on the file
+to prevent accidental or mischievous creation of
+set-user-ID and set-group-ID programs.
+This behaviour can be overridden by setting the
+.Xr sysctl 8
+variable
+.Va fs.posix.setuid
+to zero.
+.Pp
+The user invoking
+.Nm
+must belong to the specified group and be the owner of the file,
+or be the superuser.
+.Sh FILES
+.Bl -tag -width /etc/group -compact
+.It Pa /etc/group
+group ID file
+.El
+.Sh EXIT STATUS
+.Ex -std chgrp
+.Sh SEE ALSO
+.Xr chown 2 ,
+.Xr fts 3 ,
+.Xr group 5 ,
+.Xr passwd 5 ,
+.Xr symlink 7 ,
+.Xr chown 8
+.Sh STANDARDS
+The
+.Nm
+utility is compliant with the
+.St -p1003.1-2008
+specification.

+ 388 - 0
src/bin/chmod/chmod.1

@@ -0,0 +1,388 @@
+.\"	$OpenBSD: chmod.1,v 1.40 2015/03/13 19:58:40 jmc Exp $
+.\"	$NetBSD: chmod.1,v 1.8 1995/03/21 09:02:07 cgd Exp $
+.\"
+.\" Copyright (c) 1989, 1990, 1993, 1994
+.\"	The Regents of the University of California.  All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" the Institute of Electrical and Electronics Engineers, Inc.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"	@(#)chmod.1	8.4 (Berkeley) 3/31/94
+.\"
+.Dd $Mdocdate: March 13 2015 $
+.Dt CHMOD 1
+.Os
+.Sh NAME
+.Nm chmod
+.Nd change file modes
+.Sh SYNOPSIS
+.Nm chmod
+.Oo
+.Fl R
+.Op Fl H | L | P
+.Oc
+.Ar mode
+.Ar
+.Sh DESCRIPTION
+The
+.Nm
+utility modifies the file mode bits of the listed files
+as specified by the
+.Ar mode
+operand.
+The mode of a file dictates its permissions, among other attributes.
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl H
+If the
+.Fl R
+option is also specified, symbolic links on the command line are followed.
+Symbolic links encountered in the tree traversal are not followed.
+.It Fl L
+If the
+.Fl R
+option is also specified, all symbolic links are followed.
+.It Fl P
+If the
+.Fl R
+option is also specified, no symbolic links are followed.
+.It Fl R
+Recurse.
+Where
+.Ar file
+is a directory,
+change the mode of the directory and all the files and directories
+in the file hierarchy below it.
+.El
+.Pp
+Symbolic links have modes,
+but those modes have no effect on the kernel's access checks.
+The
+.Fl H ,
+.Fl L ,
+and
+.Fl P
+options are ignored unless the
+.Fl R
+option is specified;
+if none of them are given,
+the default is to not follow symbolic links.
+In addition, these options override each other and the
+command's actions are determined by the last one specified.
+.Pp
+Only the file's owner or the superuser is permitted to change
+the mode of a file.
+.Ss Absolute modes
+Absolute modes are specified according to the following format:
+.Bd -filled -offset indent
+.Nm chmod
+.Ar nnnn
+.Ar
+.Ed
+.Pp
+An absolute mode is an octal number (specified as
+.Ar nnnn ,
+where
+.Ar n
+is a number from 0 to 7) constructed by ORing
+any of the following values:
+.Pp
+.Bl -tag -width 6n -compact -offset indent
+.It Li 0400
+Allow read by owner.
+.It Li 0200
+Allow write by owner.
+.It Li 0100
+Allow execution (or search in directories) by owner.
+.It Li 0700
+Allow read, write, and execute/search by owner.
+.It Li 0040
+Allow read by group.
+.It Li 0020
+Allow write by group.
+.It Li 0010
+Allow execution (or search in directories) by group.
+.It Li 0070
+Allow read, write, and execute/search by group.
+.It Li 0004
+Allow read by others.
+.It Li 0002
+Allow write by others.
+.It Li 0001
+Allow execution (or search in directories) by others.
+.It Li 0007
+Allow read, write, and execute/search by others.
+.El
+.Pp
+In addition to the file permission modes, the following mode bits are
+available:
+.Pp
+.Bl -tag -width 6n -compact -offset indent
+.It Li 4000
+Set-user-ID on execution.
+.It Li 2000
+Set-group-ID on execution.
+.It Li 1000
+Enable sticky bit; see
+.Xr sticky 8
+and
+.Xr chmod 2 .
+.El
+.Pp
+The execute bit for a directory is often referred to as the
+.Dq search
+bit.
+In order to access a file, a user must have execute permission in each
+directory leading up to it in the filesystem hierarchy.
+For example, to access the file
+.Pa /bin/ls ,
+execute permission is needed on
+.Pa / ,
+.Pa /bin ,
+and, of course, the
+.Pa ls
+binary itself.
+.Ss Symbolic modes
+Symbolic modes are specified according to the following format:
+.Bd -filled -offset indent
+.Nm chmod
+.Sm off
+.Op Ar who
+.Ar op
+.Oo Ar perm Oc , Ar ...
+.Sm on
+.Ar
+.Ed
+.Pp
+The
+.Ar who
+symbols indicate whose permissions are to be changed or assigned:
+.Pp
+.Bl -tag -width 4n -compact -offset indent
+.It u
+User (owner) permissions.
+.It g
+Group permissions.
+.It o
+Others permissions.
+.It a
+All of the above.
+.El
+.Pp
+Do not confuse the
+.Sq o
+symbol with
+.Dq owner .
+It is the user bit,
+.Sq u ,
+that refers to the owner of the file.
+.Pp
+The
+.Ar op
+symbols represent the operation performed, as follows:
+.Bl -tag -width 4n -offset indent
+.It +
+If no value is supplied for
+.Ar perm ,
+the
+.Sq +
+operation has no effect.
+If no value is supplied for
+.Ar who ,
+each permission bit specified in
+.Ar perm ,
+for which the corresponding bit in the file mode creation mask
+is clear, is set.
+Otherwise, the mode bits represented by the specified
+.Ar who
+and
+.Ar perm
+values are set.
+.It \&\-
+If no value is supplied for
+.Ar perm ,
+the
+.Sq \-
+operation has no effect.
+If no value is supplied for
+.Ar who ,
+each permission bit specified in
+.Ar perm ,
+for which the corresponding bit in the file mode creation mask
+is clear, is cleared.
+Otherwise, the mode bits represented by the specified
+.Ar who
+and
+.Ar perm
+values are cleared.
+.It =
+The mode bits specified by the
+.Ar who
+value are cleared or, if no
+.Ar who
+value is specified, the user, group
+and other mode bits are cleared.
+Then, if no value is supplied for
+.Ar who ,
+each permission bit specified in
+.Ar perm ,
+for which the corresponding bit in the file mode creation mask
+is clear, is set.
+Otherwise, the mode bits represented by the specified
+.Ar who
+and
+.Ar perm
+values are set.
+.El
+.Pp
+The
+.Ar perm
+(permission symbols) represent the portions of the mode bits as follows:
+.Pp
+.Bl -tag -width Ds -compact -offset indent
+.It r
+Read bits.
+.It s
+Set-user-ID and set-group-ID on execution bits.
+.It t
+Sticky bit.
+.It w
+Write bits.
+.It x
+Execute/search bits.
+.It X
+The execute/search bits if the file is a directory or any of the
+execute/search bits are set in the original (unmodified) mode.
+Operations with the
+.Ar perm
+symbol
+.Sq X
+are only meaningful in conjunction with the
+.Ar op
+symbol
+.Sq + ,
+and are ignored in all other cases.
+.It u
+User permission bits in the mode of the original file.
+.It g
+Group permission bits in the mode of the original file.
+.It o
+Other permission bits in the mode of the original file.
+.El
+.Pp
+Each clause (given in a comma-delimited list on the command line) specifies
+one or more operations to be performed on the mode bits, and each operation is
+applied in the order specified.
+.Pp
+Operations upon the
+.Dq other
+permissions (specified by the symbol
+.Sq o
+by itself), in combination with the
+.Ar perm
+symbols
+.Sq s
+or
+.Sq t ,
+are ignored.
+.Sh EXIT STATUS
+.Ex -std chmod
+.Sh EXAMPLES
+Set file readable by anyone and writable by the owner only:
+.Pp
+.Dl $ chmod 644 file
+.Pp
+Deny write permission to group and others:
+.Pp
+.Dl $ chmod go-w file
+.Pp
+Set the read and write permissions to the usual defaults, but
+retain any execute permissions that are currently set:
+.Pp
+.Dl $ chmod =rw,+X file
+.Pp
+Make a directory or file searchable/executable by everyone if it is
+already searchable/executable by anyone:
+.Pp
+.Dl $ chmod +X file
+.Pp
+Any of these commands will make a file readable/executable by everyone and
+writable by the owner only:
+.Bd -literal -offset indent
+$ chmod 755 file
+$ chmod u=rwx,go=rx file
+$ chmod u=rwx,go=u-w file
+.Ed
+.Pp
+Clear all mode bits for group and others:
+.Pp
+.Dl $ chmod go= file
+.Pp
+Set the group bits equal to the user bits, but clear the group write bit:
+.Pp
+.Dl $ chmod g=u-w file
+.Sh SEE ALSO
+.Xr chflags 1 ,
+.Xr chgrp 1 ,
+.Xr find 1 ,
+.Xr install 1 ,
+.Xr chmod 2 ,
+.Xr stat 2 ,
+.Xr umask 2 ,
+.Xr fts 3 ,
+.Xr setmode 3 ,
+.Xr symlink 7 ,
+.Xr chown 8 ,
+.Xr sticky 8
+.Sh STANDARDS
+The
+.Nm
+utility is compliant with the
+.St -p1003.1-2008
+specification.
+.Pp
+The flags
+.Op Fl HLP
+are extensions to that specification.
+.Pp
+The
+.Sq t
+perm symbol (sticky bit) is marked by
+.St -p1003.1-2008
+as being an
+X/Open System Interfaces
+option.
+.Sh HISTORY
+A
+.Nm
+command appeared in
+.At v1 .
+.Sh BUGS
+There's no
+.Ar perm
+option for the naughty bits.

+ 171 - 0
src/bin/chmod/chown.8

@@ -0,0 +1,171 @@
+.\"	$OpenBSD: chown.8,v 1.18 2014/01/23 08:18:12 jmc Exp $
+.\"
+.\" Copyright (c) 1990, 1991, 1993, 1994
+.\"	The Regents of the University of California.  All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"     from: @(#)chown.8	8.3 (Berkeley) 3/31/94
+.\"
+.Dd $Mdocdate: January 23 2014 $
+.Dt CHOWN 8
+.Os
+.Sh NAME
+.Nm chown
+.Nd change file owner and group
+.Sh SYNOPSIS
+.Nm chown
+.Op Fl h
+.Oo
+.Fl R
+.Op Fl H | L | P
+.Oc
+.Ar owner Ns Op : Ns Ar group
+.Ar
+.Nm chown
+.Op Fl h
+.Oo
+.Fl R
+.Op Fl H | L | P
+.Oc
+.Pf : Ns Ar group
+.Ar
+.Sh DESCRIPTION
+.Nm
+sets the user ID and/or the group ID of the specified files.
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl H
+If the
+.Fl R
+option is specified, symbolic links on the command line are followed.
+Symbolic links encountered in the tree traversal are not followed.
+.It Fl h
+Change the user ID and/or the group ID on symbolic links.
+The
+.Fl R
+and
+.Fl h
+options are mutually exclusive.
+.It Fl L
+If the
+.Fl R
+option is specified, all symbolic links are followed.
+.It Fl P
+If the
+.Fl R
+option is specified, no symbolic links are followed.
+.It Fl R
+Recurse.
+Where
+.Ar file
+is a directory,
+change the user ID and/or the group ID of the directory
+and all the files and directories in the file hierarchy below it.
+.El
+.Pp
+The
+.Fl H ,
+.Fl L ,
+and
+.Fl P
+options are ignored unless the
+.Fl R
+option is specified;
+if none of them are given,
+the default is to not follow symbolic links.
+In addition, these options override each other and the
+command's actions are determined by the last one specified.
+.Pp
+The
+.Ar owner
+and
+.Ar group
+operands are both optional; however, one must be specified.
+If the
+.Ar group
+operand is specified, it must be preceded by a colon
+.Pq Sq \&:
+character.
+.Pp
+The
+.Ar owner
+may be either a numeric user ID or a user name.
+If a user name is also a numeric user ID, the operand is used as a
+user name.
+The
+.Ar group
+may be either a numeric group ID or a group name.
+If a group name is also a numeric group ID, the operand is used as a
+group name.
+.Pp
+By default,
+.Nm
+clears the set-user-ID and set-group-ID bits on the file
+to prevent accidental or mischievous creation of
+set-user-ID and set-group-ID programs.
+This behaviour can be overridden by setting the
+.Xr sysctl 8
+variable
+.Va fs.posix.setuid
+to zero.
+.Pp
+Only the superuser is permitted to change the owner of a file.
+.Sh EXIT STATUS
+.Ex -std chown
+.Sh SEE ALSO
+.Xr chgrp 1 ,
+.Xr find 1 ,
+.Xr chown 2 ,
+.Xr fts 3 ,
+.Xr symlink 7
+.Sh STANDARDS
+The
+.Nm
+utility is compliant with the
+.St -p1003.1-2008
+specification.
+.Pp
+The ability to specify
+.Ar group
+without
+.Ar owner
+is an extension to that specification.
+.Pp
+Some
+.Pf non- Bx
+systems may allow the (non-privileged) owner of a file to change
+its ownership.
+.Pp
+Previous versions of the
+.Nm
+utility used the dot
+.Pq Sq \&.
+character to distinguish the group name.
+This has been changed to be a colon
+.Pq Sq \&:
+character so that user and
+group names may contain the dot character.

+ 250 - 0
src/bin/cp/cp.1

@@ -0,0 +1,250 @@
+.\"	$OpenBSD: cp.1,v 1.37 2014/03/19 14:42:44 tedu Exp $
+.\"	$NetBSD: cp.1,v 1.9 1995/07/25 19:36:45 jtc Exp $
+.\"
+.\" Copyright (c) 1989, 1990, 1993, 1994
+.\"	The Regents of the University of California.  All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" the Institute of Electrical and Electronics Engineers, Inc.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"	@(#)cp.1	8.3 (Berkeley) 4/18/94
+.\"
+.Dd $Mdocdate: March 19 2014 $
+.Dt CP 1
+.Os
+.Sh NAME
+.Nm cp
+.Nd copy files
+.Sh SYNOPSIS
+.Nm cp
+.Op Fl fip
+.Oo
+.Fl R
+.Op Fl H | L | P
+.Oc
+.Ar source target
+.Nm cp
+.Op Fl fip
+.Oo
+.Fl R
+.Op Fl H | L | P
+.Oc
+.Ar source ... directory
+.Sh DESCRIPTION
+In the first synopsis form, the
+.Nm
+utility copies the contents of the
+.Ar source
+file to the
+.Ar target
+file.
+In the second synopsis form,
+the contents of each named
+.Ar source
+file are copied to the destination
+.Ar directory .
+The names of the files themselves are not changed.
+If
+.Nm
+detects an attempt to copy a file to itself, the copy will fail.
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl f
+For each existing destination pathname, remove it and
+create a new file, without prompting for confirmation,
+regardless of its permissions.
+The
+.Fl f
+option overrides any previous
+.Fl i
+options.
+.It Fl H
+If the
+.Fl R
+option is also specified, symbolic links on the command line are followed.
+Symbolic links encountered in the tree traversal are not followed.
+.It Fl i
+Write a prompt to the standard error output before copying a file
+that would overwrite an existing file.
+If the response from the standard input begins with the character
+.Sq Li y ,
+the file copy is attempted.
+The
+.Fl i
+option overrides any previous
+.Fl f
+options.
+.It Fl L
+If the
+.Fl R
+option is also specified, all symbolic links are followed.
+.It Fl P
+If the
+.Fl R
+option is also specified, no symbolic links are followed.
+.It Fl p
+Preserve in the copy as many of the modification time, access time,
+file flags, file mode, user ID, and group ID as allowed by permissions.
+.Pp
+If the user ID and group ID cannot be preserved, no error message
+is displayed and the exit value is not altered.
+.Pp
+If the source file has its set-user-ID bit on and the user ID cannot
+be preserved, the set-user-ID bit is not preserved
+in the copy's permissions.
+If the source file has its set-group-ID bit on and the group ID cannot
+be preserved, the set-group-ID bit is not preserved
+in the copy's permissions.
+If the source file has both its set-user-ID and set-group-ID bits on,
+and either the user ID or group ID cannot be preserved, neither
+the set-user-ID nor set-group-ID bits are preserved in the copy's
+permissions.
+.It Fl R
+If
+.Ar source
+designates a directory,
+.Nm
+copies the directory and the entire subtree connected at that point.
+Created directories have the same mode as the corresponding source
+directory, unmodified by the process's umask.
+.Pp
+This option also causes symbolic links to be copied, rather than
+followed, and
+special files to be created, rather than being copied as normal files.
+However,
+.Nm
+copies hard linked files as separate files.
+To preserve hard links,
+use a utility such as
+.Xr pax 1
+or
+.Xr tar 1
+instead.
+.El
+.Pp
+For each destination file that already exists, its contents are
+overwritten if permissions allow, but its mode, user ID, and group
+ID are unchanged.
+.Pp
+In the second synopsis form,
+the destination specified by the
+.Ar directory
+operand must exist unless there is only one named
+.Ar source
+which is a directory and the
+.Fl R
+flag is specified.
+.Pp
+If the destination file does not exist, the mode of the source file is
+used as modified by the file mode creation mask
+.Pf ( Ic umask ,
+see
+.Xr csh 1 ) .
+If the source file has its set-user-ID bit on, that bit is removed
+unless both the source file and the destination file are owned by the
+same user.
+If the source file has its set-group-ID bit on, that bit is removed
+unless both the source file and the destination file are in the same
+group and the user is a member of that group.
+If both the set-user-ID and set-group-ID bits are set, all of the above
+conditions must be fulfilled or both bits are removed.
+.Pp
+Appropriate permissions are required for file creation or overwriting.
+.Pp
+When a file containing large blocks of zero-valued bytes is copied,
+.Nm
+will attempt to create a sparse file.
+.Pp
+Symbolic links are always followed unless the
+.Fl R
+flag is set, in which case symbolic links are not followed, by default.
+The
+.Fl H
+or
+.Fl L
+flags (in conjunction with the
+.Fl R
+flag) cause symbolic links to be followed as described above.
+The
+.Fl H ,
+.Fl L ,
+and
+.Fl P
+options are ignored unless the
+.Fl R
+option is specified.
+In addition, these options override each other and the
+command's actions are determined by the last one specified.
+.Sh EXIT STATUS
+.Ex -std cp
+.Sh EXAMPLES
+Make a copy of file
+.Pa foo
+named
+.Pa bar :
+.Pp
+.Dl $ cp foo bar
+.Pp
+Copy a group of files to the
+.Pa /tmp
+directory:
+.Pp
+.Dl $ cp *.txt /tmp
+.Pp
+Copy the directory
+.Pa junk
+and all of its contents (including any subdirectories) to the
+.Pa /tmp
+directory:
+.Pp
+.Dl $ cp -R junk /tmp
+.Sh SEE ALSO
+.Xr mv 1 ,
+.Xr umask 2 ,
+.Xr fts 3 ,
+.Xr symlink 7
+.Sh STANDARDS
+The
+.Nm
+utility is compliant with the
+.St -p1003.1-2008
+specification.
+.Pp
+Historic versions of the
+.Nm
+utility had a
+.Fl r
+option.
+This implementation supports that option; however, its use is strongly
+discouraged, as it does not correctly copy special files, symbolic links
+or FIFOs.
+.Sh HISTORY
+A
+.Nm
+command appeared in
+.At v1 .

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1015 - 0
src/bin/csh/USD.doc/csh.1


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 2793 - 0
src/bin/csh/csh.1


+ 0 - 0
src/bin/date/date.1


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels