svn commit: r248342 - in head/bin: cp ls mkdir mv ps rm rmdir

Joel Dahl joel at FreeBSD.org
Fri Mar 15 20:12:56 UTC 2013


Author: joel (doc committer)
Date: Fri Mar 15 20:12:54 2013
New Revision: 248342
URL: http://svnweb.freebsd.org/changeset/base/248342

Log:
  Add a few examples.
  
  Obtained from:	OpenBSD

Modified:
  head/bin/cp/cp.1
  head/bin/ls/ls.1
  head/bin/mkdir/mkdir.1
  head/bin/mv/mv.1
  head/bin/ps/ps.1
  head/bin/rm/rm.1
  head/bin/rmdir/rmdir.1

Modified: head/bin/cp/cp.1
==============================================================================
--- head/bin/cp/cp.1	Fri Mar 15 20:00:08 2013	(r248341)
+++ head/bin/cp/cp.1	Fri Mar 15 20:12:54 2013	(r248342)
@@ -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 fil
 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

Modified: head/bin/ls/ls.1
==============================================================================
--- head/bin/ls/ls.1	Fri Mar 15 20:00:08 2013	(r248341)
+++ head/bin/ls/ls.1	Fri Mar 15 20:12:54 2013	(r248342)
@@ -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

Modified: head/bin/mkdir/mkdir.1
==============================================================================
--- head/bin/mkdir/mkdir.1	Fri Mar 15 20:00:08 2013	(r248341)
+++ head/bin/mkdir/mkdir.1	Fri Mar 15 20:12:54 2013	(r248342)
@@ -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, li
 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

Modified: head/bin/mv/mv.1
==============================================================================
--- head/bin/mv/mv.1	Fri Mar 15 20:00:08 2013	(r248341)
+++ head/bin/mv/mv.1	Fri Mar 15 20:12:54 2013	(r248342)
@@ -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 ,

Modified: head/bin/ps/ps.1
==============================================================================
--- head/bin/ps/ps.1	Fri Mar 15 20:00:08 2013	(r248341)
+++ head/bin/ps/ps.1	Fri Mar 15 20:12:54 2013	(r248342)
@@ -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 
 .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 ,

Modified: head/bin/rm/rm.1
==============================================================================
--- head/bin/rm/rm.1	Fri Mar 15 20:00:08 2013	(r248341)
+++ head/bin/rm/rm.1	Fri Mar 15 20:12:54 2013	(r248342)
@@ -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

Modified: head/bin/rmdir/rmdir.1
==============================================================================
--- head/bin/rmdir/rmdir.1	Fri Mar 15 20:00:08 2013	(r248341)
+++ head/bin/rmdir/rmdir.1	Fri Mar 15 20:12:54 2013	(r248342)
@@ -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


More information about the svn-src-all mailing list