1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-24 07:40:52 +00:00

Add a few examples.

Obtained from:	OpenBSD
This commit is contained in:
Joel Dahl 2013-03-15 20:12:54 +00:00
parent 302868d914
commit e9e3a1ab1f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=248342
7 changed files with 102 additions and 7 deletions

View File

@ -32,7 +32,7 @@
.\" @(#)cp.1 8.3 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
.Dd September 4, 2012
.Dd March 15, 2013
.Dt CP 1
.Os
.Sh NAME
@ -251,6 +251,27 @@ signal, the current input and output file and the percentage complete
will be written to the standard output.
.Sh EXIT STATUS
.Ex -std
.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 COMPATIBILITY
Historic versions of the
.Nm

View File

@ -32,7 +32,7 @@
.\" @(#)ls.1 8.7 (Berkeley) 7/29/94
.\" $FreeBSD$
.\"
.Dd November 8, 2012
.Dd March 15, 2013
.Dt LS 1
.Os
.Sh NAME
@ -718,6 +718,24 @@ for more information.
.El
.Sh EXIT STATUS
.Ex -std
.Sh EXAMPLES
List the contents of the current working directory in long format:
.Pp
.Dl $ ls -l
.Pp
In addition to listing the contents of the current working directory in
long format, show inode numbers, file flags (see
.Xr chflags 1 ) ,
and suffix each filename with a symbol representing its file type:
.Pp
.Dl $ ls -lioF
.Pp
List the files in
.Pa /var/log ,
sorting the output such that the mostly recently modified entries are
printed first:
.Pp
.Dl $ ls -lt /var/log
.Sh COMPATIBILITY
The group field is now automatically included in the long listing for
files in order to be compatible with the

View File

@ -32,7 +32,7 @@
.\" @(#)mkdir.1 8.2 (Berkeley) 1/25/94
.\" $FreeBSD$
.\"
.Dd January 25, 1994
.Dd March 15, 2013
.Dt MKDIR 1
.Os
.Sh NAME
@ -87,6 +87,23 @@ Be verbose when creating directories, listing them as they are created.
The user must have write permission in the parent directory.
.Sh EXIT STATUS
.Ex -std
.Sh EXAMPLES
Create a directory named
.Pa foobar :
.Pp
.Dl $ mkdir foobar
.Pp
Create a directory named
.Pa foobar
and set its file mode to 700:
.Pp
.Dl $ mkdir -m 700 foobar
.Pp
Create a directory named
.Pa cow/horse/monkey ,
creating any non-existent intermediate directories as necessary:
.Pp
.Dl $ mkdir -p cow/horse/monkey
.Sh COMPATIBILITY
The
.Fl v

View File

@ -32,7 +32,7 @@
.\" @(#)mv.1 8.1 (Berkeley) 5/31/93
.\" $FreeBSD$
.\"
.Dd August 28, 2012
.Dd March 15, 2013
.Dt MV 1
.Os
.Sh NAME
@ -155,6 +155,16 @@ rm -rf source_file
.Ed
.Sh EXIT STATUS
.Ex -std
.Sh EXAMPLES
Rename file
.Pa foo
to
.Pa bar ,
overwriting
.Pa bar
if it already exists:
.Pp
.Dl $ mv -f foo bar
.Sh COMPATIBILITY
The
.Fl h ,

View File

@ -29,7 +29,7 @@
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
.Dd February 7, 2013
.Dd March 15, 2013
.Dt PS 1
.Os
.Sh NAME
@ -689,6 +689,10 @@ attempts to automatically determine the terminal width.
.It Pa /boot/kernel/kernel
default system namelist
.El
.Sh EXAMPLES
Display information on all system processes:
.Pp
.Dl $ ps -auxw
.Sh SEE ALSO
.Xr kill 1 ,
.Xr pgrep 1 ,

View File

@ -32,7 +32,7 @@
.\" @(#)rm.1 8.5 (Berkeley) 12/5/94
.\" $FreeBSD$
.\"
.Dd October 31, 2010
.Dd March 15, 2013
.Dt RM 1
.Os
.Sh NAME
@ -193,6 +193,19 @@ When
is specified with
.Fl f
the file will be overwritten and removed even if it has hard links.
.Sh EXAMPLES
Recursively remove all files contained within the
.Pa foobar
directory hierarchy:
.Pp
.Dl $ rm -rf foobar
.Pp
Either of these commands will remove the file
.Pa -f :
.Bd -literal -offset indent
$ rm -- -f
$ rm ./-f
.Ed
.Sh COMPATIBILITY
The
.Nm

View File

@ -32,7 +32,7 @@
.\" @(#)rmdir.1 8.1 (Berkeley) 5/31/93
.\" $FreeBSD$
.\"
.Dd March 21, 2004
.Dd March 15, 2013
.Dt RMDIR 1
.Os
.Sh NAME
@ -86,6 +86,18 @@ successfully.
.It Li >0
An error occurred.
.El
.Sh EXAMPLES
Remove the directory
.Pa foobar ,
if it is empty:
.Pp
.Dl $ rmdir foobar
.Pp
Remove all directories up to and including
.Pa cow ,
stopping at the first non-empty directory (if any):
.Pp
.Dl $ rmdir -p cow/horse/monkey
.Sh SEE ALSO
.Xr rm 1
.Sh STANDARDS