diff options
author | joel <joel@FreeBSD.org> | 2013-03-15 20:12:54 +0000 |
---|---|---|
committer | joel <joel@FreeBSD.org> | 2013-03-15 20:12:54 +0000 |
commit | 2ba67e203aad1ffa4650449d05e44a2b61e99ad6 (patch) | |
tree | 33ce444ce5867809f8179d3cfcb13267eb94e1c0 /bin | |
parent | 90b1ba3bc42c541bb65e1492274cdbdeca8d1dea (diff) | |
download | FreeBSD-src-2ba67e203aad1ffa4650449d05e44a2b61e99ad6.zip FreeBSD-src-2ba67e203aad1ffa4650449d05e44a2b61e99ad6.tar.gz |
Add a few examples.
Obtained from: OpenBSD
Diffstat (limited to 'bin')
-rw-r--r-- | bin/cp/cp.1 | 23 | ||||
-rw-r--r-- | bin/ls/ls.1 | 20 | ||||
-rw-r--r-- | bin/mkdir/mkdir.1 | 19 | ||||
-rw-r--r-- | bin/mv/mv.1 | 12 | ||||
-rw-r--r-- | bin/ps/ps.1 | 6 | ||||
-rw-r--r-- | bin/rm/rm.1 | 15 | ||||
-rw-r--r-- | bin/rmdir/rmdir.1 | 14 |
7 files changed, 102 insertions, 7 deletions
diff --git a/bin/cp/cp.1 b/bin/cp/cp.1 index 8c014b4..169f350 100644 --- a/bin/cp/cp.1 +++ b/bin/cp/cp.1 @@ -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 diff --git a/bin/ls/ls.1 b/bin/ls/ls.1 index aa4fc18..7c72652 100644 --- a/bin/ls/ls.1 +++ b/bin/ls/ls.1 @@ -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 diff --git a/bin/mkdir/mkdir.1 b/bin/mkdir/mkdir.1 index 0f8d812..d702348 100644 --- a/bin/mkdir/mkdir.1 +++ b/bin/mkdir/mkdir.1 @@ -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 diff --git a/bin/mv/mv.1 b/bin/mv/mv.1 index 5199f27..298dbf9 100644 --- a/bin/mv/mv.1 +++ b/bin/mv/mv.1 @@ -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 , diff --git a/bin/ps/ps.1 b/bin/ps/ps.1 index 7f69137..1a364f5 100644 --- a/bin/ps/ps.1 +++ b/bin/ps/ps.1 @@ -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 , diff --git a/bin/rm/rm.1 b/bin/rm/rm.1 index ad81066..3588f38 100644 --- a/bin/rm/rm.1 +++ b/bin/rm/rm.1 @@ -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 diff --git a/bin/rmdir/rmdir.1 b/bin/rmdir/rmdir.1 index 688d144..ededd43 100644 --- a/bin/rmdir/rmdir.1 +++ b/bin/rmdir/rmdir.1 @@ -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 |