From f1ecb9249eb97f91502dd12fdecf98a4e38f64fb Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Wed, 20 Jan 2016 03:38:37 -0800 Subject: [PATCH 01/14] Cal: Condense examples to single line. --- pages/common/cal.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pages/common/cal.md b/pages/common/cal.md index 839395730..e1cc92c76 100644 --- a/pages/common/cal.md +++ b/pages/common/cal.md @@ -2,18 +2,18 @@ > Prints calendar information. -- Display a calendar for the current month or specified month: +- Display a calendar for the current month: `cal` -`cal -m {{12}}` -`cal -m {{Dec}}` -- Display a calendar for the current year or a specified year: +- Display a calendar for a specific month: + +`cal -m {{month_number}}` + +- Display all 12 months of calendar for a specific year: -`cal -y` `cal 2013` - Display date of Easter (western churches): -`ncal -e` -`ncal -e 2013` +`ncal -e {{year}}` From c0dad323d9db0e847a68763656b0f2d4703e10e9 Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Wed, 20 Jan 2016 03:39:15 -0800 Subject: [PATCH 02/14] LS: Condense examples to single line, removing glob and sorting examples. --- pages/common/ls.md | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/pages/common/ls.md b/pages/common/ls.md index c1f3a1c10..472e87da7 100644 --- a/pages/common/ls.md +++ b/pages/common/ls.md @@ -2,33 +2,22 @@ > List directory contents. -- List all files, even hidden: +- List files one per line: + +`ls -1` + +- List all files, including hidden files: `ls -a` -- List all file names (no extra info): +- Long format list (permissions, ownership, size and modification date) of all files: -`ls -A1` +`ls -la` -- List all files with their rights, groups, owner: - -`ls -l` - -- List all files and display the file size in a human readable format: +- Long format list with size displayed using human readable units (KB,MB,GB): `ls -lh` -- List all files with a prefix/suffix: +- Long format list sorted by size (descending): -`ls {{prefix}}*` -`ls *{{suffix}}` - -- Sort the results by size, last modified date, or creation date: - -`ls -S` -`ls -t` -`ls -U` - -- Reverse the order of the results: - -`ls -r` +`ls -lS` From 52560585f970fe733ee0604b6292a39ebefceda0 Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Wed, 20 Jan 2016 03:39:49 -0800 Subject: [PATCH 03/14] Redis-cli: Condense, add note about default port. --- pages/common/redis-cli.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pages/common/redis-cli.md b/pages/common/redis-cli.md index 0dee280f2..8c960f6e2 100644 --- a/pages/common/redis-cli.md +++ b/pages/common/redis-cli.md @@ -6,9 +6,12 @@ `redis-cli` -- Connect to a remote server: +- Connect to a remote server on the default port (6379): `redis-cli -h {{host}}` + +- Connect to a remote server specifying a port number: + `redis-cli -h {{host}} -p {{port}}` - Specify a password: From 4c5b0ac2227919b304232224d8485aaad0556894 Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Wed, 20 Jan 2016 03:41:12 -0800 Subject: [PATCH 04/14] Rename: Condense and remove flags which require a newer version of perl. (--nows and -c are available on Ubuntu14) --- pages/common/rename.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pages/common/rename.md b/pages/common/rename.md index 6ce55a2d7..86108ccdf 100644 --- a/pages/common/rename.md +++ b/pages/common/rename.md @@ -2,19 +2,18 @@ > Renames multiple files. -- Change foo to bar in matching filenames: +- Rename files using a Perl Common Regular Expression (substitute 'foo' with 'bar' wherever found): -`rename {{'s/foo/bar/'}} {{*.txt}}` +`rename {{'s/foo/bar/'}} {{\*}}` -- Convert to lower case: +- Dry-run, display which renames would occur without performing them: -`rename -c {{*.txt}}` +`rename -n {{'s/foo/bar/'}} {{\*}}` + +- Convert filenames to lower case: + +`rename 'y/A-Z/a-z/' {{\*}}` - Replace whitespace with underscores: -`rename --nows {{*.txt}}` -`rename 's/\s+/_/g' {{*.txt}}` - -- No action, just show what renames would occur: - -`rename -n {{'s/foo/bar/'}} {{*.txt}}` +`rename 's/\s+/_/g' {{\*}}` From 16549758f1e06583a97dd362e0d38996e3653104 Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Wed, 20 Jan 2016 03:41:38 -0800 Subject: [PATCH 05/14] salt-key: split combined examples. --- pages/common/salt-key.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pages/common/salt-key.md b/pages/common/salt-key.md index 5acf21995..a0352a5cc 100644 --- a/pages/common/salt-key.md +++ b/pages/common/salt-key.md @@ -7,9 +7,12 @@ `salt-key -L` -- Accept or reject a minion key by name: +- Accept a minion key by name: `salt-key -a {{MINION_ID}}` + +- Reject a minion key by name: + `salt-key -r {{MINION_ID}}` - Print fingerprints of all public keys: From a53e772333b5f6829f8fe85e70a260be75fbfe28 Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Wed, 20 Jan 2016 03:42:47 -0800 Subject: [PATCH 06/14] srm: Condense and reword. Remove 35-pass example cause it's crazy-town. --- pages/common/srm.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pages/common/srm.md b/pages/common/srm.md index 12aa163ad..8528e4ce0 100644 --- a/pages/common/srm.md +++ b/pages/common/srm.md @@ -1,17 +1,19 @@ # srm > Securely remove files or directories. -> Overwrites the existing data one or multiple. Drop in replacement for rm. +> Overwrites the existing data one or multiple times. Drop in replacement for rm. -- Remove a file after overwriting (single pass, 7 pass, 35 pass): +- Remove a file after a single pass overwriting with random data: `srm -s {{/path/to/file}}` + +- Remove a file after seven passes overwriting it with random data: + `srm -m {{/path/to/file}}` -`srm {{/path/to/file}}` -- Scurely remove recursively a directory and all it's subdirectories: +- Recursively remove a directory and contents overwriting each file with a single pass of random data. -`srm -r {{/path/to/folder}}` +`srm -r -s {{/path/to/folder}}` - Prompt before every removal: From 93b96be95cf67044844f0ccd9f0e2b98f289455b Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Wed, 20 Jan 2016 03:44:25 -0800 Subject: [PATCH 07/14] touch: Remove hard coded date example. Reorder wording for -r. --- pages/common/touch.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pages/common/touch.md b/pages/common/touch.md index 155f3885c..87efa390c 100644 --- a/pages/common/touch.md +++ b/pages/common/touch.md @@ -6,11 +6,10 @@ `touch {{filename}}` -- Set the times on a file to those specified: +- Set the times on a file to a specific date and time: -`touch -t 201412250801.59 {{filename}}` `touch -t {{YYYYMMDDHHMM.SS}} {{filename}}` -- Set the times on a file to match those on second file: +- Use the times from a file to set the times on a second file: -`touch -r {{filename2}} {{filename}}` +`touch -r {{filename}} {{filename2}}` From 246d490e6e44a90ad25d565c290d79796965403e Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Wed, 20 Jan 2016 03:44:52 -0800 Subject: [PATCH 08/14] which: Mention what a search path is. Remove explicit example. --- pages/common/which.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pages/common/which.md b/pages/common/which.md index 78efa5173..b5447c752 100644 --- a/pages/common/which.md +++ b/pages/common/which.md @@ -2,9 +2,8 @@ > Locate the a program in the user's path. -- Display the path of an executable program: +- Search the PATH environment variable and display the location of any matching executables: -`which {{ls}}` `which {{executable}}` - If there are multiple executables which match, display all: From 2e2390b1bdf5158793c2ae644601b857d6f5ce76 Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Wed, 20 Jan 2016 03:45:42 -0800 Subject: [PATCH 09/14] Condense SHA and MD5 examples. --- pages/linux/md5sum.md | 6 ++++-- pages/linux/sha1sum.md | 6 ++++-- pages/linux/sha224sum.md | 6 ++++-- pages/linux/sha256sum.md | 6 ++++-- pages/linux/sha384sum.md | 6 ++++-- pages/linux/sha512sum.md | 6 ++++-- pages/osx/md5.md | 5 ++--- 7 files changed, 26 insertions(+), 15 deletions(-) diff --git a/pages/linux/md5sum.md b/pages/linux/md5sum.md index e7a1730a9..4dcd6fbc4 100644 --- a/pages/linux/md5sum.md +++ b/pages/linux/md5sum.md @@ -2,11 +2,13 @@ > Calculate MD5 cryptographic checksums. -- Calculate the MD5 checksum for file(s) or files in a directory, one checksum per file: +- Calculate the MD5 checksum for a file: `md5sum {{filename1}}` + +- Calculate MD5 checksums for multiple files: + `md5sum {{filename1}} {{filename2}}` -`md5sum {{directory/\*}}` - Read a file of MD5SUMs and verify all files have matching checksums: diff --git a/pages/linux/sha1sum.md b/pages/linux/sha1sum.md index bc4967756..fbc8aeaa6 100644 --- a/pages/linux/sha1sum.md +++ b/pages/linux/sha1sum.md @@ -2,11 +2,13 @@ > Calculate SHA1 cryptographic checksums. -- Calculate the SHA1 checksum for file(s) or files in a directory, one checksum per file: +- Calculate the SHA1 checksum for a file: `sha1sum {{filename1}}` + +- Calculate SHA1 checksums for multiple files: + `sha1sum {{filename1}} {{filename2}}` -`sha1sum {{directory/\*}}` - Read a file of SHA1 sums and verify all files have matching checksums: diff --git a/pages/linux/sha224sum.md b/pages/linux/sha224sum.md index 6698a4592..e2058e21c 100644 --- a/pages/linux/sha224sum.md +++ b/pages/linux/sha224sum.md @@ -2,11 +2,13 @@ > Calculate SHA224 cryptographic checksums. -- Calculate the SHA224 checksum for file(s) or files in a directory, one checksum per file: +- Calculate the SHA224 checksum for a file: `sha224sum {{filename1}}` + +- Calculate SHA224 checksums for multiple files: + `sha224sum {{filename1}} {{filename2}}` -`sha224sum {{directory/\*}}` - Read a file of SHA224 sums and verify all files have matching checksums: diff --git a/pages/linux/sha256sum.md b/pages/linux/sha256sum.md index 6b1407ee4..8e73608a4 100644 --- a/pages/linux/sha256sum.md +++ b/pages/linux/sha256sum.md @@ -2,11 +2,13 @@ > Calculate SHA256 cryptographic checksums. -- Calculate the SHA256 checksum for file(s) or files in a directory, one checksum per file: +- Calculate the SHA256 checksum for a file: `sha256sum {{filename1}}` + +- Calculate SHA224 checksums for multiple files: + `sha256sum {{filename1}} {{filename2}}` -`sha256sum {{directory/\*}}` - Read a file of SHA256 sums and verify all files have matching checksums: diff --git a/pages/linux/sha384sum.md b/pages/linux/sha384sum.md index 96be653d9..3dcbaba2e 100644 --- a/pages/linux/sha384sum.md +++ b/pages/linux/sha384sum.md @@ -2,11 +2,13 @@ > Calculate SHA384 cryptographic checksums. -- Calculate the SHA384 checksum for file(s) or files in a directory, one checksum per file: +- Calculate the SHA384 checksum for a file: `sha384sum {{filename1}}` + +- Calculate SHA384 checksums for multiple files: + `sha384sum {{filename1}} {{filename2}}` -`sha384sum {{directory/\*}}` - Read a file of SHA384 sums and verify all files have matching checksums: diff --git a/pages/linux/sha512sum.md b/pages/linux/sha512sum.md index 55f3cdb16..18b8d115e 100644 --- a/pages/linux/sha512sum.md +++ b/pages/linux/sha512sum.md @@ -2,11 +2,13 @@ > Calculate SHA512 cryptographic checksums. -- Calculate the SHA512 checksum for file(s) or files in a directory, one checksum per file: +- Calculate the SHA384 checksum for a file: `sha512sum {{filename1}}` + +- Calculate SHA384 checksums for multiple files: + `sha512sum {{filename1}} {{filename2}}` -`sha512sum {{directory/\*}}` - Read a file of SHA512 sums and verify all files have matching checksums: diff --git a/pages/osx/md5.md b/pages/osx/md5.md index ecf043424..8e7da5b26 100644 --- a/pages/osx/md5.md +++ b/pages/osx/md5.md @@ -2,14 +2,13 @@ > Calculate MD5 cryptographic checksums. -- Print MD5 checksum for a file: +- Calculate the MD5 checksum for a file: `md5 {{filename}}` -- Print MD5 checksum for each file in a list or directory: +- Calculate MD5 checksums for multiple files: `md5 {{filename1}} {{filename2}}` -`md5 {{directory/\*}}` - Output only the md5 checksum (no filename): From 35a697f99c7cc6ebb2db8143ca9b853c1f676601 Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Wed, 20 Jan 2016 03:46:22 -0800 Subject: [PATCH 10/14] Sysctl: Condense by removing explicit maxfiles example. --- pages/osx/sysctl.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pages/osx/sysctl.md b/pages/osx/sysctl.md index 92ba1ddad..2cde48192 100644 --- a/pages/osx/sysctl.md +++ b/pages/osx/sysctl.md @@ -20,5 +20,4 @@ - Set a changeable kernel state variable: -`sysctl -w name=value` -`sysctl -w kern.maxfiles=15000` +`sysctl -w {{section.tunable}}={{value}}` From 88b6cb879d6fd9d0c23f08cff0dbadd01098172e Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Wed, 20 Jan 2016 03:47:48 -0800 Subject: [PATCH 11/14] systemsetup: combine the seperate examples. The options are super self-documenting and very helpful together. --- pages/osx/systemsetup.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pages/osx/systemsetup.md b/pages/osx/systemsetup.md index cf92e0793..147baf7d7 100644 --- a/pages/osx/systemsetup.md +++ b/pages/osx/systemsetup.md @@ -8,17 +8,16 @@ - Specify TimeZone, NTP Server and enable network time: -`systemsetup -settimezone {{US/Pacific}}` -`systemsetup -setnetworktimeserver {{us.pool.ntp.org}}` -`systemsetup -setusingnetworktime on` +`systemsetup -settimezone {{US/Pacific}} -setnetworktimeserver {{us.pool.ntp.org}} -setusingnetworktime on` -- Make the machine never sleep; restart on freeze & power failure: +- Make the machine never sleep and automatically restart on power failure or kernel panic: -`systemsetup -setsleep off` -`systemsetup -setrestartpowerfailure on` -`systemsetup -setrestartfreeze on` +`systemsetup -setsleep off -setrestartpowerfailure on -setrestartfreeze on` -- List valid startup disks, specify a new startup disk: +- List valid startup disks: `systemsetup -liststartupdisks` + +- Specify a new startup disk + `systemsetup -setstartupdisk {{path}}` From 2399de48308df730236b228c928c6eb055d2a6f7 Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Wed, 20 Jan 2016 03:48:16 -0800 Subject: [PATCH 12/14] xed: Remove multi-file open example. --- pages/osx/xed.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pages/osx/xed.md b/pages/osx/xed.md index 962012d7b..754739233 100644 --- a/pages/osx/xed.md +++ b/pages/osx/xed.md @@ -2,10 +2,9 @@ > Opens files for editing in XCode. -- Open file(s) in XCode: +- Open file in XCode: `xed {{file1}}` -`xed {{/path/to/file1}} {{/path/to/file2}}` - Open file(s) in XCode, create if it doesn't exist: From f36e1216811ad449019c9fd2bc361cb2a0208894 Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Wed, 20 Jan 2016 03:52:51 -0800 Subject: [PATCH 13/14] Linting fixes. --- pages/common/srm.md | 2 +- pages/osx/systemsetup.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/common/srm.md b/pages/common/srm.md index 8528e4ce0..396bc7c57 100644 --- a/pages/common/srm.md +++ b/pages/common/srm.md @@ -11,7 +11,7 @@ `srm -m {{/path/to/file}}` -- Recursively remove a directory and contents overwriting each file with a single pass of random data. +- Recursively remove a directory and contents overwriting each file with a single pass of random data: `srm -r -s {{/path/to/folder}}` diff --git a/pages/osx/systemsetup.md b/pages/osx/systemsetup.md index 147baf7d7..431beae76 100644 --- a/pages/osx/systemsetup.md +++ b/pages/osx/systemsetup.md @@ -18,6 +18,6 @@ `systemsetup -liststartupdisks` -- Specify a new startup disk +- Specify a new startup disk: `systemsetup -setstartupdisk {{path}}` From 750580dbe6dacb98141b4dc805535a9e043ceedb Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Wed, 20 Jan 2016 09:59:42 -0800 Subject: [PATCH 14/14] Single line text refinements. --- pages/common/cal.md | 8 ++++++-- pages/common/ls.md | 2 +- pages/common/rename.md | 2 +- pages/common/srm.md | 6 +++--- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/pages/common/cal.md b/pages/common/cal.md index e1cc92c76..de90cc23b 100644 --- a/pages/common/cal.md +++ b/pages/common/cal.md @@ -10,9 +10,13 @@ `cal -m {{month_number}}` -- Display all 12 months of calendar for a specific year: +- Display a 12 month calendar for the current year: -`cal 2013` +`cal -y` + +- Display a 12 month calendar for a specific year: + +`cal 2016` - Display date of Easter (western churches): diff --git a/pages/common/ls.md b/pages/common/ls.md index 472e87da7..3976fe47a 100644 --- a/pages/common/ls.md +++ b/pages/common/ls.md @@ -14,7 +14,7 @@ `ls -la` -- Long format list with size displayed using human readable units (KB,MB,GB): +- Long format list with size displayed using human readable units (KB, MB, GB): `ls -lh` diff --git a/pages/common/rename.md b/pages/common/rename.md index 86108ccdf..4affd41ed 100644 --- a/pages/common/rename.md +++ b/pages/common/rename.md @@ -6,7 +6,7 @@ `rename {{'s/foo/bar/'}} {{\*}}` -- Dry-run, display which renames would occur without performing them: +- Dry-run - display which renames would occur without performing them: `rename -n {{'s/foo/bar/'}} {{\*}}` diff --git a/pages/common/srm.md b/pages/common/srm.md index 396bc7c57..532c491ff 100644 --- a/pages/common/srm.md +++ b/pages/common/srm.md @@ -3,15 +3,15 @@ > Securely remove files or directories. > Overwrites the existing data one or multiple times. Drop in replacement for rm. -- Remove a file after a single pass overwriting with random data: +- Remove a file after a single-pass overwriting with random data: `srm -s {{/path/to/file}}` -- Remove a file after seven passes overwriting it with random data: +- Remove a file after seven passes of overwriting with random data: `srm -m {{/path/to/file}}` -- Recursively remove a directory and contents overwriting each file with a single pass of random data: +- Recursively remove a directory and its contents overwriting each file with a single-pass of random data: `srm -r -s {{/path/to/folder}}`