Merge pull request #699 from notpeter/single-command

waldyrious/alt-syntax
Igor Shubovych 2016-01-20 21:07:01 +02:00
commit eb6526a550
18 changed files with 84 additions and 78 deletions

View File

@ -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}}`

View File

@ -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`

View File

@ -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:

View File

@ -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' {{\*}}`

View File

@ -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:

View File

@ -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:

View File

@ -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}}`

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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):

View File

@ -20,5 +20,4 @@
- Set a changeable kernel state variable:
`sysctl -w name=value`
`sysctl -w kern.maxfiles=15000`
`sysctl -w {{section.tunable}}={{value}}`

View File

@ -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}}`

View File

@ -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: