mirror of https://github.com/CrimsonTome/tldr.git
Merge pull request #658 from rubenvereecken/fix-all-of-the-syntaxes
Fix all of the syntaxeswaldyrious/alt-syntax
commit
60d61f559d
|
@ -3,18 +3,18 @@
|
||||||
> Quickly jump among the directories you visit the most.
|
> Quickly jump among the directories you visit the most.
|
||||||
> Aliases like j or jc are provided for even less typing.
|
> Aliases like j or jc are provided for even less typing.
|
||||||
|
|
||||||
- Jump to a directory that contains the given pattern.
|
- Jump to a directory that contains the given pattern:
|
||||||
|
|
||||||
`j {{pattern}}`
|
`j {{pattern}}`
|
||||||
|
|
||||||
- Jump to a sub-directory (child) of the current directory that contains the given pattern.
|
- Jump to a sub-directory (child) of the current directory that contains the given pattern:
|
||||||
|
|
||||||
`jc {{pattern}}`
|
`jc {{pattern}}`
|
||||||
|
|
||||||
- Remove non-existing directories from the autojump database.
|
- Remove non-existing directories from the autojump database:
|
||||||
|
|
||||||
`j --purge`
|
`j --purge`
|
||||||
|
|
||||||
- Show the entries in the autojump database.
|
- Show the entries in the autojump database:
|
||||||
|
|
||||||
`j -s`
|
`j -s`
|
||||||
|
|
|
@ -3,26 +3,26 @@
|
||||||
> Runs, monitors and restarts SSH connections.
|
> Runs, monitors and restarts SSH connections.
|
||||||
> Auto-reconnects to keep port forwarding tunnels up. Accepts all ssh flags.
|
> Auto-reconnects to keep port forwarding tunnels up. Accepts all ssh flags.
|
||||||
|
|
||||||
- Open an SSH session, restarting when a monitoring port fails return data.
|
- Open an SSH session, restarting when a monitoring port fails return data:
|
||||||
|
|
||||||
`autossh -M {{monitor_port}} {{ssh_command}}`
|
`autossh -M {{monitor_port}} {{ssh_command}}`
|
||||||
|
|
||||||
- Open an SSH session which forwards a local port to a remote one, restarting if necessary.
|
- Open an SSH session which forwards a local port to a remote one, restarting if necessary:
|
||||||
|
|
||||||
`autossh -M {{monitor_port}} -L {{local_port}}:localhost:{{remote_port}} {{user}}@{{host}}`
|
`autossh -M {{monitor_port}} -L {{local_port}}:localhost:{{remote_port}} {{user}}@{{host}}`
|
||||||
|
|
||||||
- Fork before executing ssh (runs in the background) and don't open a remote shell.
|
- Fork before executing ssh (runs in the background) and don't open a remote shell:
|
||||||
|
|
||||||
`autossh -f -M {{monitor_port}} -N {{ssh_command}}`
|
`autossh -f -M {{monitor_port}} -N {{ssh_command}}`
|
||||||
|
|
||||||
- Run autossh in the background, with no monitoring port instead relying on SSH keep-alives every 10secs to detect failure.
|
- Run autossh in the background, with no monitoring port instead relying on SSH keep-alives every 10secs to detect failure:
|
||||||
|
|
||||||
`autossh -f -M 0 -N -o "ServerAliveInterval 10" -o "ServerAliveCountMax 3" {{ssh_command}}`
|
`autossh -f -M 0 -N -o "ServerAliveInterval 10" -o "ServerAliveCountMax 3" {{ssh_command}}`
|
||||||
|
|
||||||
- Run autossh in the background, with no monitoring port, no remote shell, exiting if the port forward fails.
|
- Run autossh in the background, with no monitoring port, no remote shell, exiting if the port forward fails:
|
||||||
|
|
||||||
`autossh -f -M 0 -N -o "ServerAliveInterval 10" -o "ServerAliveCountMax 3" -o ExitOnForwardFailure=yes -L {{local_port}}:localhost:{{remote_port}} {{user}}@{{host}}`
|
`autossh -f -M 0 -N -o "ServerAliveInterval 10" -o "ServerAliveCountMax 3" -o ExitOnForwardFailure=yes -L {{local_port}}:localhost:{{remote_port}} {{user}}@{{host}}`
|
||||||
|
|
||||||
- Run autossh in the background with debug output logged to a file, ssh verbose output logged to a second file.
|
- Run autossh in the background with debug output logged to a file, ssh verbose output logged to a second file:
|
||||||
|
|
||||||
`AUTOSSH_DEBUG=1 AUTOSSH_LOGFILE={{log_file}} autossh -f -M {{monitor_port}} -v -E {{ssh_logfile}} {{ssh_command}}`
|
`AUTOSSH_DEBUG=1 AUTOSSH_LOGFILE={{log_file}} autossh -f -M {{monitor_port}} -v -E {{ssh_logfile}} {{ssh_command}}`
|
||||||
|
|
|
@ -2,18 +2,18 @@
|
||||||
|
|
||||||
> Create or Copy blockmaps intelligently (and therefore faster than `cp` or `dd`).
|
> Create or Copy blockmaps intelligently (and therefore faster than `cp` or `dd`).
|
||||||
|
|
||||||
- Create a blockmap from image file.
|
- Create a blockmap from image file:
|
||||||
|
|
||||||
`bmaptool create -o {{blockmap.bmap}} {{source.img}}`
|
`bmaptool create -o {{blockmap.bmap}} {{source.img}}`
|
||||||
|
|
||||||
- Copy an image file into sdb.
|
- Copy an image file into sdb:
|
||||||
|
|
||||||
`bmaptool copy --bmap {{blockmap.bmap}} {{source.img}} {{/dev/sdb}}`
|
`bmaptool copy --bmap {{blockmap.bmap}} {{source.img}} {{/dev/sdb}}`
|
||||||
|
|
||||||
- Copy a compressed image file into sdb.
|
- Copy a compressed image file into sdb:
|
||||||
|
|
||||||
`bmaptool copy --bmap {{blockmap.bmap}} {{source.img.gz}} {{/dev/sdb}}`
|
`bmaptool copy --bmap {{blockmap.bmap}} {{source.img.gz}} {{/dev/sdb}}`
|
||||||
|
|
||||||
- Copy an image file into sdb without using a blockmap.
|
- Copy an image file into sdb without using a blockmap:
|
||||||
|
|
||||||
`bmaptool copy --nobmap {{source.img}} {{/dev/sdb}}`
|
`bmaptool copy --nobmap {{source.img}} {{/dev/sdb}}`
|
||||||
|
|
|
@ -10,10 +10,10 @@
|
||||||
|
|
||||||
`file -z {{foo.zip}}`
|
`file -z {{foo.zip}}`
|
||||||
|
|
||||||
- Allow file to work with special or device files.
|
- Allow file to work with special or device files:
|
||||||
|
|
||||||
`file -s {{filename}}`
|
`file -s {{filename}}`
|
||||||
|
|
||||||
- Don't stop at first file type match; keep going until the end of the file.
|
- Don't stop at first file type match; keep going until the end of the file:
|
||||||
|
|
||||||
`file -k {{filename}}`
|
`file -k {{filename}}`
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
# for
|
# for
|
||||||
|
|
||||||
> Shell loop over parameters
|
> Shell loop over parameters.
|
||||||
|
|
||||||
- Perform a command with different arguments.
|
- Perform a command with different arguments:
|
||||||
|
|
||||||
`for argument in 1 2 3; do {{command $argument}}; done`
|
`for argument in 1 2 3; do {{command $argument}}; done`
|
||||||
|
|
||||||
- Perform a command in every directory.
|
- Perform a command in every directory:
|
||||||
|
|
||||||
`for d in *; do (cd $d; {{command}}); done`
|
`for d in *; do (cd $d; {{command}}); done`
|
||||||
|
|
|
@ -2,22 +2,22 @@
|
||||||
|
|
||||||
> A cross-platform system monitoring tool.
|
> A cross-platform system monitoring tool.
|
||||||
|
|
||||||
- run in terminal.
|
- Run in terminal:
|
||||||
|
|
||||||
`glances`
|
`glances`
|
||||||
|
|
||||||
- run in web server mode to show results in browser.
|
- Run in web server mode to show results in browser:
|
||||||
|
|
||||||
`glances -w`
|
`glances -w`
|
||||||
|
|
||||||
- run in server mode to allow connections from other Glances clients.
|
- Run in server mode to allow connections from other Glances clients:
|
||||||
|
|
||||||
`glances -s`
|
`glances -s`
|
||||||
|
|
||||||
- connect to a Glances server.
|
- Connect to a Glances server:
|
||||||
|
|
||||||
`glances -c {{hostname}}`
|
`glances -c {{hostname}}`
|
||||||
|
|
||||||
- require a password in (web) server mode.
|
- Require a password in (web) server mode:
|
||||||
|
|
||||||
`glances -s --password`
|
`glances -s --password`
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
# if
|
# if
|
||||||
|
|
||||||
> Simple shell conditional
|
> Simple shell conditional.
|
||||||
|
|
||||||
- Echo a different thing depending on a command's success.
|
- Echo a different thing depending on a command's success:
|
||||||
|
|
||||||
`{{command}} && echo "success" || echo "failure"`
|
`{{command}} && echo "success" || echo "failure"`
|
||||||
|
|
||||||
- Full if syntax.
|
- Full if syntax:
|
||||||
|
|
||||||
`if {{condition}}; then echo "true"; else echo "false"; fi`
|
`if {{condition}}; then echo "true"; else echo "false"; fi`
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# lsof
|
# lsof
|
||||||
|
|
||||||
> Lists open files and the corresponding processes
|
> Lists open files and the corresponding processes.
|
||||||
> Note: In most cases, you need root privilege (or use sudo) because you want to list files opened by others
|
> Note: In most cases, you need root privilege (or use sudo) because you want to list files opened by others.
|
||||||
|
|
||||||
- Find the processes that have a given file open:
|
- Find the processes that have a given file open:
|
||||||
|
|
||||||
|
@ -11,14 +11,14 @@
|
||||||
|
|
||||||
`lsof -i :{{port}}`
|
`lsof -i :{{port}}`
|
||||||
|
|
||||||
- only output the process PID
|
- Only output the process PI:
|
||||||
|
|
||||||
`lsof -t {{/path/to/file}}`
|
`lsof -t {{/path/to/file}}`
|
||||||
|
|
||||||
- list files opened by the given user
|
- List files opened by the given use:
|
||||||
|
|
||||||
`lsof -u {{username}}`
|
`lsof -u {{username}}`
|
||||||
|
|
||||||
- list files opened by the given command or process
|
- List files opened by the given command or proces:
|
||||||
|
|
||||||
`lsof -c {{process_or_command_name}}`
|
`lsof -c {{process_or_command_name}}`
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# pg_dump
|
# pg_dump
|
||||||
|
|
||||||
> Extract a PostgreSQL database into a script file or other archive file
|
> Extract a PostgreSQL database into a script file or other archive file.
|
||||||
|
|
||||||
- Dump database into a SQL-script file:
|
- Dump database into a SQL-script file:
|
||||||
|
|
||||||
|
|
|
@ -2,22 +2,22 @@
|
||||||
|
|
||||||
> Sails.js is a realtime enterprise level MVC framework built on top of Node.js.
|
> Sails.js is a realtime enterprise level MVC framework built on top of Node.js.
|
||||||
|
|
||||||
- Start Sails
|
- Start Sail:
|
||||||
|
|
||||||
`sails lift`
|
`sails lift`
|
||||||
|
|
||||||
- Create new Sails project
|
- Create new Sails projec:
|
||||||
|
|
||||||
`sails new {{projectName}}`
|
`sails new {{projectName}}`
|
||||||
|
|
||||||
- Generate Sails API
|
- Generate Sails AP:
|
||||||
|
|
||||||
`sails generate {{name}}`
|
`sails generate {{name}}`
|
||||||
|
|
||||||
- Generate Sails Controller
|
- Generate Sails Controlle:
|
||||||
|
|
||||||
`sails generate controller {{name}}`
|
`sails generate controller {{name}}`
|
||||||
|
|
||||||
- Generate Sails Model
|
- Generate Sails Mode:
|
||||||
|
|
||||||
`sails generate model {{name}}`
|
`sails generate model {{name}}`
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
# ssh-keygen
|
# ssh-keygen
|
||||||
|
|
||||||
> Generate ssh keys user for authentication, password-less logins, and other things
|
> Generate ssh keys user for authentication, password-less logins, and other things.
|
||||||
|
|
||||||
- generate a key interactively
|
- Generate a key interactivel:
|
||||||
|
|
||||||
`ssh-keygen`
|
`ssh-keygen`
|
||||||
|
|
||||||
- generate a DSA 2048 bit (default) key
|
- Generate a DSA 2048 bit (default) ke:
|
||||||
|
|
||||||
`ssh-keygen -t dsa`
|
`ssh-keygen -t dsa`
|
||||||
|
|
||||||
- generate an RSA 4096 bit key with your email as a comment
|
- Generate an RSA 4096 bit key with your email as a commen:
|
||||||
|
|
||||||
`ssh-keygen -t rsa -b 4096 -C "{{email}}"`
|
`ssh-keygen -t rsa -b 4096 -C "{{email}}"`
|
||||||
|
|
||||||
- Retrieve the key fingerprint from a host (useful for confirming the authenticity of the host when first connecting to it via SSH)
|
- Retrieve the key fingerprint from a host (useful for confirming the authenticity of the host when first connecting to it via SSH:
|
||||||
|
|
||||||
`ssh-keygen -l -F {{remote_host}}`
|
`ssh-keygen -l -F {{remote_host}}`
|
||||||
|
|
|
@ -10,6 +10,6 @@
|
||||||
|
|
||||||
`su`
|
`su`
|
||||||
|
|
||||||
- Switch to user {{username}} and simulate a full login shell
|
- Switch to user {{username}} and simulate a full login shel:
|
||||||
|
|
||||||
`su - {{username}}`
|
`su - {{username}}`
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
- Default escape character:
|
- Default escape character:
|
||||||
|
|
||||||
`CTRL` + `]`
|
`CTRL + ]`
|
||||||
|
|
||||||
- Specify an escape character (x is the escape character):
|
- Specify an escape character (x is the escape character):
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
# while
|
# while
|
||||||
|
|
||||||
> Simple shell loop
|
> Simple shell loop.
|
||||||
|
|
||||||
- Read stdin and perform an action on every line.
|
- Read stdin and perform an action on every line:
|
||||||
|
|
||||||
`while read line; do echo "$line"; done`
|
`while read line; do echo "$line"; done`
|
||||||
|
|
||||||
- Execute a command forever once every second.
|
- Execute a command forever once every second:
|
||||||
|
|
||||||
`while :; do {{command}}; sleep 1; done`
|
`while :; do {{command}}; sleep 1; done`
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
# apt-key
|
# apt-key
|
||||||
|
|
||||||
> Key management utility for the APT Package Manager on Debian and Ubuntu
|
> Key management utility for the APT Package Manager on Debian and Ubuntu.
|
||||||
|
|
||||||
- List trusted keys
|
- List trusted key:
|
||||||
|
|
||||||
`apt-key list`
|
`apt-key list`
|
||||||
|
|
||||||
- Add a key to the trusted keystore
|
- Add a key to the trusted keystor:
|
||||||
|
|
||||||
`apt-key add {{public_key_file.asc}}`
|
`apt-key add {{public_key_file.asc}}`
|
||||||
|
|
||||||
- Delete a key from the trusted keystore
|
- Delete a key from the trusted keystor:
|
||||||
|
|
||||||
`apt-key del {{key_id}}`
|
`apt-key del {{key_id}}`
|
||||||
|
|
||||||
- Add a remote key to the trusted keystore
|
- Add a remote key to the trusted keystor:
|
||||||
|
|
||||||
`wget -qO - {{https://host.tld/filename.key}} | apt-key add -`
|
`wget -qO - {{https://host.tld/filename.key}} | apt-key add -`
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
> Run command or interactive shell with special root directory.
|
> Run command or interactive shell with special root directory.
|
||||||
|
|
||||||
- Run command as new root directory
|
- Run command as new root director:
|
||||||
|
|
||||||
`chroot {{/path/to/new/root}} {{command}}`
|
`chroot {{/path/to/new/root}} {{command}}`
|
||||||
|
|
||||||
- specify user and group (ID or name) to use
|
- Specify user and group (ID or name) to us:
|
||||||
|
|
||||||
`chroot −−userspec={{user:group}}`
|
`chroot −−userspec={{user:group}}`
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
# lsblk
|
# lsblk
|
||||||
|
|
||||||
> lists information about devices
|
> Lists information about devices.
|
||||||
|
|
||||||
- list all storage devices in a tree-like format.
|
- List all storage devices in a tree-like format:
|
||||||
|
|
||||||
`lsblk`
|
`lsblk`
|
||||||
|
|
||||||
- Also list empty devices.
|
- Also list empty devices:
|
||||||
|
|
||||||
`lsblk −a`
|
`lsblk −a`
|
||||||
|
|
||||||
- Print the SIZE column in bytes rather than in a human-readable format.
|
- Print the SIZE column in bytes rather than in a human-readable format:
|
||||||
|
|
||||||
`lsblk −b`
|
`lsblk −b`
|
||||||
|
|
||||||
- Output info about filesystems.
|
- Output info about filesystems:
|
||||||
|
|
||||||
`lsblk −f`
|
`lsblk −f`
|
||||||
|
|
||||||
- Use ASCII characters for tree formatting.
|
- Use ASCII characters for tree formatting:
|
||||||
|
|
||||||
`lsblk −i`
|
`lsblk −i`
|
||||||
|
|
||||||
- Output info about block-device topology.
|
- Output info about block-device topology:
|
||||||
|
|
||||||
`lsblk −t`
|
`lsblk −t`
|
||||||
|
|
Loading…
Reference in New Issue