diff --git a/pages/common/cal.md b/pages/common/cal.md index 839395730..de90cc23b 100644 --- a/pages/common/cal.md +++ b/pages/common/cal.md @@ -2,18 +2,22 @@ > 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 a 12 month calendar for the current year: `cal -y` -`cal 2013` + +- Display a 12 month calendar for a specific year: + +`cal 2016` - Display date of Easter (western churches): -`ncal -e` -`ncal -e 2013` +`ncal -e {{year}}` diff --git a/pages/common/ls.md b/pages/common/ls.md index c1f3a1c10..3976fe47a 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` 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: diff --git a/pages/common/rename.md b/pages/common/rename.md index 6ce55a2d7..4affd41ed 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' {{\*}}` 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: diff --git a/pages/common/srm.md b/pages/common/srm.md index 12aa163ad..532c491ff 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 of overwriting 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 its 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: 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}}` 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: 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): 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}}` diff --git a/pages/osx/systemsetup.md b/pages/osx/systemsetup.md index cf92e0793..431beae76 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}}` 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: