mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-22 08:42:08 +02:00
Merge pull request #699 from notpeter/single-command
This commit is contained in:
commit
eb6526a550
18 changed files with 84 additions and 78 deletions
|
@ -2,18 +2,22 @@
|
||||||
|
|
||||||
> Prints calendar information.
|
> Prints calendar information.
|
||||||
|
|
||||||
- Display a calendar for the current month or specified month:
|
- Display a calendar for the current month:
|
||||||
|
|
||||||
`cal`
|
`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 -y`
|
||||||
`cal 2013`
|
|
||||||
|
- Display a 12 month calendar for a specific year:
|
||||||
|
|
||||||
|
`cal 2016`
|
||||||
|
|
||||||
- Display date of Easter (western churches):
|
- Display date of Easter (western churches):
|
||||||
|
|
||||||
`ncal -e`
|
`ncal -e {{year}}`
|
||||||
`ncal -e 2013`
|
|
||||||
|
|
|
@ -2,33 +2,22 @@
|
||||||
|
|
||||||
> List directory contents.
|
> List directory contents.
|
||||||
|
|
||||||
- List all files, even hidden:
|
- List files one per line:
|
||||||
|
|
||||||
|
`ls -1`
|
||||||
|
|
||||||
|
- List all files, including hidden files:
|
||||||
|
|
||||||
`ls -a`
|
`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:
|
- Long format list with size displayed using human readable units (KB, MB, GB):
|
||||||
|
|
||||||
`ls -l`
|
|
||||||
|
|
||||||
- List all files and display the file size in a human readable format:
|
|
||||||
|
|
||||||
`ls -lh`
|
`ls -lh`
|
||||||
|
|
||||||
- List all files with a prefix/suffix:
|
- Long format list sorted by size (descending):
|
||||||
|
|
||||||
`ls {{prefix}}*`
|
`ls -lS`
|
||||||
`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`
|
|
||||||
|
|
|
@ -6,9 +6,12 @@
|
||||||
|
|
||||||
`redis-cli`
|
`redis-cli`
|
||||||
|
|
||||||
- Connect to a remote server:
|
- Connect to a remote server on the default port (6379):
|
||||||
|
|
||||||
`redis-cli -h {{host}}`
|
`redis-cli -h {{host}}`
|
||||||
|
|
||||||
|
- Connect to a remote server specifying a port number:
|
||||||
|
|
||||||
`redis-cli -h {{host}} -p {{port}}`
|
`redis-cli -h {{host}} -p {{port}}`
|
||||||
|
|
||||||
- Specify a password:
|
- Specify a password:
|
||||||
|
|
|
@ -2,19 +2,18 @@
|
||||||
|
|
||||||
> Renames multiple files.
|
> 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:
|
- Replace whitespace with underscores:
|
||||||
|
|
||||||
`rename --nows {{*.txt}}`
|
`rename 's/\s+/_/g' {{\*}}`
|
||||||
`rename 's/\s+/_/g' {{*.txt}}`
|
|
||||||
|
|
||||||
- No action, just show what renames would occur:
|
|
||||||
|
|
||||||
`rename -n {{'s/foo/bar/'}} {{*.txt}}`
|
|
||||||
|
|
|
@ -7,9 +7,12 @@
|
||||||
|
|
||||||
`salt-key -L`
|
`salt-key -L`
|
||||||
|
|
||||||
- Accept or reject a minion key by name:
|
- Accept a minion key by name:
|
||||||
|
|
||||||
`salt-key -a {{MINION_ID}}`
|
`salt-key -a {{MINION_ID}}`
|
||||||
|
|
||||||
|
- Reject a minion key by name:
|
||||||
|
|
||||||
`salt-key -r {{MINION_ID}}`
|
`salt-key -r {{MINION_ID}}`
|
||||||
|
|
||||||
- Print fingerprints of all public keys:
|
- Print fingerprints of all public keys:
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
# srm
|
# srm
|
||||||
|
|
||||||
> Securely remove files or directories.
|
> 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}}`
|
`srm -s {{/path/to/file}}`
|
||||||
|
|
||||||
|
- Remove a file after seven passes of overwriting with random data:
|
||||||
|
|
||||||
`srm -m {{/path/to/file}}`
|
`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:
|
- Prompt before every removal:
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,10 @@
|
||||||
|
|
||||||
`touch {{filename}}`
|
`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}}`
|
`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}}`
|
||||||
|
|
|
@ -2,9 +2,8 @@
|
||||||
|
|
||||||
> Locate the a program in the user's path.
|
> 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}}`
|
`which {{executable}}`
|
||||||
|
|
||||||
- If there are multiple executables which match, display all:
|
- If there are multiple executables which match, display all:
|
||||||
|
|
|
@ -2,11 +2,13 @@
|
||||||
|
|
||||||
> Calculate MD5 cryptographic checksums.
|
> 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}}`
|
`md5sum {{filename1}}`
|
||||||
|
|
||||||
|
- Calculate MD5 checksums for multiple files:
|
||||||
|
|
||||||
`md5sum {{filename1}} {{filename2}}`
|
`md5sum {{filename1}} {{filename2}}`
|
||||||
`md5sum {{directory/\*}}`
|
|
||||||
|
|
||||||
- Read a file of MD5SUMs and verify all files have matching checksums:
|
- Read a file of MD5SUMs and verify all files have matching checksums:
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,13 @@
|
||||||
|
|
||||||
> Calculate SHA1 cryptographic checksums.
|
> 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}}`
|
`sha1sum {{filename1}}`
|
||||||
|
|
||||||
|
- Calculate SHA1 checksums for multiple files:
|
||||||
|
|
||||||
`sha1sum {{filename1}} {{filename2}}`
|
`sha1sum {{filename1}} {{filename2}}`
|
||||||
`sha1sum {{directory/\*}}`
|
|
||||||
|
|
||||||
- Read a file of SHA1 sums and verify all files have matching checksums:
|
- Read a file of SHA1 sums and verify all files have matching checksums:
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,13 @@
|
||||||
|
|
||||||
> Calculate SHA224 cryptographic checksums.
|
> 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}}`
|
`sha224sum {{filename1}}`
|
||||||
|
|
||||||
|
- Calculate SHA224 checksums for multiple files:
|
||||||
|
|
||||||
`sha224sum {{filename1}} {{filename2}}`
|
`sha224sum {{filename1}} {{filename2}}`
|
||||||
`sha224sum {{directory/\*}}`
|
|
||||||
|
|
||||||
- Read a file of SHA224 sums and verify all files have matching checksums:
|
- Read a file of SHA224 sums and verify all files have matching checksums:
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,13 @@
|
||||||
|
|
||||||
> Calculate SHA256 cryptographic checksums.
|
> 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}}`
|
`sha256sum {{filename1}}`
|
||||||
|
|
||||||
|
- Calculate SHA224 checksums for multiple files:
|
||||||
|
|
||||||
`sha256sum {{filename1}} {{filename2}}`
|
`sha256sum {{filename1}} {{filename2}}`
|
||||||
`sha256sum {{directory/\*}}`
|
|
||||||
|
|
||||||
- Read a file of SHA256 sums and verify all files have matching checksums:
|
- Read a file of SHA256 sums and verify all files have matching checksums:
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,13 @@
|
||||||
|
|
||||||
> Calculate SHA384 cryptographic checksums.
|
> 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}}`
|
`sha384sum {{filename1}}`
|
||||||
|
|
||||||
|
- Calculate SHA384 checksums for multiple files:
|
||||||
|
|
||||||
`sha384sum {{filename1}} {{filename2}}`
|
`sha384sum {{filename1}} {{filename2}}`
|
||||||
`sha384sum {{directory/\*}}`
|
|
||||||
|
|
||||||
- Read a file of SHA384 sums and verify all files have matching checksums:
|
- Read a file of SHA384 sums and verify all files have matching checksums:
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,13 @@
|
||||||
|
|
||||||
> Calculate SHA512 cryptographic checksums.
|
> 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}}`
|
`sha512sum {{filename1}}`
|
||||||
|
|
||||||
|
- Calculate SHA384 checksums for multiple files:
|
||||||
|
|
||||||
`sha512sum {{filename1}} {{filename2}}`
|
`sha512sum {{filename1}} {{filename2}}`
|
||||||
`sha512sum {{directory/\*}}`
|
|
||||||
|
|
||||||
- Read a file of SHA512 sums and verify all files have matching checksums:
|
- Read a file of SHA512 sums and verify all files have matching checksums:
|
||||||
|
|
||||||
|
|
|
@ -2,14 +2,13 @@
|
||||||
|
|
||||||
> Calculate MD5 cryptographic checksums.
|
> Calculate MD5 cryptographic checksums.
|
||||||
|
|
||||||
- Print MD5 checksum for a file:
|
- Calculate the MD5 checksum for a file:
|
||||||
|
|
||||||
`md5 {{filename}}`
|
`md5 {{filename}}`
|
||||||
|
|
||||||
- Print MD5 checksum for each file in a list or directory:
|
- Calculate MD5 checksums for multiple files:
|
||||||
|
|
||||||
`md5 {{filename1}} {{filename2}}`
|
`md5 {{filename1}} {{filename2}}`
|
||||||
`md5 {{directory/\*}}`
|
|
||||||
|
|
||||||
- Output only the md5 checksum (no filename):
|
- Output only the md5 checksum (no filename):
|
||||||
|
|
||||||
|
|
|
@ -20,5 +20,4 @@
|
||||||
|
|
||||||
- Set a changeable kernel state variable:
|
- Set a changeable kernel state variable:
|
||||||
|
|
||||||
`sysctl -w name=value`
|
`sysctl -w {{section.tunable}}={{value}}`
|
||||||
`sysctl -w kern.maxfiles=15000`
|
|
||||||
|
|
|
@ -8,17 +8,16 @@
|
||||||
|
|
||||||
- Specify TimeZone, NTP Server and enable network time:
|
- Specify TimeZone, NTP Server and enable network time:
|
||||||
|
|
||||||
`systemsetup -settimezone {{US/Pacific}}`
|
`systemsetup -settimezone {{US/Pacific}} -setnetworktimeserver {{us.pool.ntp.org}} -setusingnetworktime on`
|
||||||
`systemsetup -setnetworktimeserver {{us.pool.ntp.org}}`
|
|
||||||
`systemsetup -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 -setsleep off -setrestartpowerfailure on -setrestartfreeze on`
|
||||||
`systemsetup -setrestartpowerfailure on`
|
|
||||||
`systemsetup -setrestartfreeze on`
|
|
||||||
|
|
||||||
- List valid startup disks, specify a new startup disk:
|
- List valid startup disks:
|
||||||
|
|
||||||
`systemsetup -liststartupdisks`
|
`systemsetup -liststartupdisks`
|
||||||
|
|
||||||
|
- Specify a new startup disk:
|
||||||
|
|
||||||
`systemsetup -setstartupdisk {{path}}`
|
`systemsetup -setstartupdisk {{path}}`
|
||||||
|
|
|
@ -2,10 +2,9 @@
|
||||||
|
|
||||||
> Opens files for editing in XCode.
|
> Opens files for editing in XCode.
|
||||||
|
|
||||||
- Open file(s) in XCode:
|
- Open file in XCode:
|
||||||
|
|
||||||
`xed {{file1}}`
|
`xed {{file1}}`
|
||||||
`xed {{/path/to/file1}} {{/path/to/file2}}`
|
|
||||||
|
|
||||||
- Open file(s) in XCode, create if it doesn't exist:
|
- Open file(s) in XCode, create if it doesn't exist:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue