Update shortcut keys
This commit is contained in:
parent
f700af2fcc
commit
538863edd4
196
command_line.md
196
command_line.md
|
@ -5,129 +5,169 @@ layout: default
|
||||||
|
|
||||||
## List (ls)
|
## List (ls)
|
||||||
|
|
||||||
Usage:
|
|
||||||
|
|
||||||
ls [options] [paths]
|
ls [options] [paths]
|
||||||
|
|
||||||
Format:
|
### Format
|
||||||
|
|
||||||
-1 One entry per line
|
| Switch | Description |
|
||||||
-l Long view
|
|---|---|
|
||||||
-o Long view (without groups)
|
| `-1` | One entry per line |
|
||||||
-C Multicolumn (sorted horizontally)
|
| `-l` | Long view |
|
||||||
-x Multicolumn (sorted vertically)
|
| `-o` | Long view (without groups) |
|
||||||
|
| `-C` | Multicolumn (sorted horizontally) |
|
||||||
|
| `-x` | Multicolumn (sorted vertically) |
|
||||||
|
|---
|
||||||
|
| `-F` | Add / after directories |
|
||||||
|
| `-G` | Color |
|
||||||
|
{:.shortcuts}
|
||||||
|
|
||||||
-F Add / after directories
|
### Options
|
||||||
-G Color
|
|
||||||
|
|
||||||
Options:
|
| `-R` | Recurse |
|
||||||
|
| `-a` | Include hidden (dotfiles) |
|
||||||
|
| `-A` | Include hidden (but not . and ..) |
|
||||||
|
{:.shortcuts}
|
||||||
|
|
||||||
-R Recurse
|
### Sorting
|
||||||
-a Include hidden (dotfiles)
|
|
||||||
-A Include hidden (but not . and ..)
|
|
||||||
|
|
||||||
Sorting:
|
| Switch | Description |
|
||||||
|
|---|---|
|
||||||
|
| `-r` | reverse order |
|
||||||
|
| `-S` | sort by size |
|
||||||
|
| `-t` | sort by time modified |
|
||||||
|
| `-u` | sort by time accessed |
|
||||||
|
| `-U` | sort by time created |
|
||||||
|
| `-c` | sort by time status was changed |
|
||||||
|
|---
|
||||||
|
| `-h` | Human-readable size (3k) |
|
||||||
|
{:.shortcuts}
|
||||||
|
|
||||||
-r reverse order
|
<br>
|
||||||
-S sort by size
|
|
||||||
-t sort by time modified
|
|
||||||
-u sort by time accessed
|
|
||||||
-U sort by time created
|
|
||||||
-c sort by time status was changed
|
|
||||||
|
|
||||||
-h Human-readable size (3k)
|
|
||||||
|
|
||||||
## Tail
|
## Tail
|
||||||
|
|
||||||
Usage:
|
|
||||||
|
|
||||||
tail [-F | -f | -r] [-bN | -cN | -nN] [file ...]
|
tail [-F | -f | -r] [-bN | -cN | -nN] [file ...]
|
||||||
|
|
||||||
Modes:
|
### Modes
|
||||||
|
|
||||||
-f # follow
|
| `-f` | follow |
|
||||||
-F # follow by filename (accounts for log rotation)
|
| `-F` | follow by filename (accounts for log rotation) |
|
||||||
-r # Reverse order
|
| `-r` | Reverse order |
|
||||||
|
{:.shortcuts}
|
||||||
|
|
||||||
Options:
|
### Options
|
||||||
|
|
||||||
-bN # N*512 bytes
|
| `-bN` | N*512 bytes |
|
||||||
-cN # N bytes
|
| `-cN` | N bytes |
|
||||||
-nN # N lines
|
| `-nN` | N lines |
|
||||||
|
| `+N` | Start from line N |
|
||||||
|
{:.shortcuts}
|
||||||
|
|
||||||
+N # Start from line N
|
<br>
|
||||||
|
|
||||||
## Sudo
|
## Sudo
|
||||||
|
|
||||||
Listing:
|
```
|
||||||
|
sudo [options] <command>
|
||||||
|
```
|
||||||
|
|
||||||
-l # List allowed commands
|
### Listing
|
||||||
|
|
||||||
Options:
|
| `-l` | List allowed commands |
|
||||||
|
{:.shortcuts}
|
||||||
|
|
||||||
-A # Use $SUDO_ASKPASS
|
### Options
|
||||||
-b # Run in background
|
|
||||||
-E # Preserve environment
|
|
||||||
-H # use target's $HOME
|
|
||||||
-n # Don't prompt for password
|
|
||||||
-P # Preserve group vector
|
|
||||||
-S # Read password from stdin
|
|
||||||
|
|
||||||
File descriptors:
|
| `-A` | Use $SUDO_ASKPASS |
|
||||||
|
| `-b` | Run in background |
|
||||||
|
| `-E` | Preserve environment |
|
||||||
|
| `-H` | use target's $HOME |
|
||||||
|
| `-n` | Don't prompt for password |
|
||||||
|
| `-P` | Preserve group vector |
|
||||||
|
| `-S` | Read password from stdin |
|
||||||
|
{:.shortcuts}
|
||||||
|
|
||||||
-C fd # Close all open file descriptors
|
### File descriptors
|
||||||
|
|
||||||
Prompt:
|
| `-C fd` | Close all open file descriptors |
|
||||||
|
{:.shortcuts}
|
||||||
|
|
||||||
-p prompt # Custom prompt (-p "%p password:")
|
### Prompt
|
||||||
|
|
||||||
Interactive:
|
| `-p prompt` | Custom prompt (-p "%p password:") |
|
||||||
|
{:.shortcuts}
|
||||||
|
|
||||||
-i [cmd] # Interactive shell without variables
|
### Interactive
|
||||||
-s [cmd] # Interactive shell
|
|
||||||
|
|
||||||
-u user # run as this user
|
| Switch | Description |
|
||||||
-g group # run as this group
|
|---|---|
|
||||||
|
| `-i [cmd]` | Interactive shell without variables |
|
||||||
|
| `-s [cmd]` | Interactive shell |
|
||||||
|
|----
|
||||||
|
| `-u user` | run as this user |
|
||||||
|
| `-g group` | run as this group |
|
||||||
|
{:.shortcuts}
|
||||||
|
|
||||||
Timestamp:
|
### Timestamp
|
||||||
|
|
||||||
-v # revalidate timestamp for 5 mins
|
| `-v` | revalidate timestamp for 5 mins |
|
||||||
-k # invalidate timestamp
|
| `-k` | invalidate timestamp |
|
||||||
-K # just like -k
|
| `-K` | just like -k |
|
||||||
|
{:.shortcuts}
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
## wc (Word count)
|
## wc (Word count)
|
||||||
|
|
||||||
-c # Bytes
|
```
|
||||||
-l # Lines
|
... | wc [options]
|
||||||
-m # Characters (incl multi-byte)
|
```
|
||||||
-w # Words
|
|
||||||
|
| `-c` | Bytes |
|
||||||
|
| `-l` | Lines |
|
||||||
|
| `-m` | Characters (incl multi-byte) |
|
||||||
|
| `-w` | Words |
|
||||||
|
{:.shortcuts}
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
## Search-and-replace in all files
|
## Search-and-replace in all files
|
||||||
|
|
||||||
perl -p -i -e 's/hello/HELLO/g' **/*
|
perl -p -i -e 's/hello/HELLO/g' **/*
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
## Grep
|
## Grep
|
||||||
|
|
||||||
-A num # Print `num` lines of training context
|
```
|
||||||
|
grep [options] [pattern] [file ...]
|
||||||
|
```
|
||||||
|
|
||||||
-G # --basic-regexp (default)
|
### Options
|
||||||
-E # --extended-regexp
|
|
||||||
-P # --perl-regexp
|
|
||||||
|
|
||||||
-f file # --file (Get patterns for file)
|
| Switch | Description |
|
||||||
-F # --fixed-strings
|
|---|---|
|
||||||
|
| `-A num` | Print `num` lines of training context |
|
||||||
|
|----
|
||||||
|
| `-G` | --basic-regexp (default) |
|
||||||
|
| `-E` | --extended-regexp |
|
||||||
|
| `-P` | --perl-regexp |
|
||||||
|
|----
|
||||||
|
| `-f file` | --file (Get patterns for file) |
|
||||||
|
| `-F` | --fixed-strings |
|
||||||
|
|----
|
||||||
|
| `-h` | --no-filename |
|
||||||
|
| `-H` | --with-filename |
|
||||||
|
|----
|
||||||
|
| `-l` | --files-with-matches (just print filenames) |
|
||||||
|
| `-L` | --files-without-match |
|
||||||
|
|----
|
||||||
|
| `-r, -R` | --recursive |
|
||||||
|
| `-v` | --invert-match |
|
||||||
|
| `-i` | --ignore-case |
|
||||||
|
{:.shortcuts}
|
||||||
|
|
||||||
-h # --no-filename
|
### Synonyms
|
||||||
-H # --with-filename
|
|
||||||
|
|
||||||
-l # --files-with-matches (just print filenames)
|
|
||||||
-L # --files-without-match
|
|
||||||
|
|
||||||
-r, -R # --recursive
|
|
||||||
-v # --invert-match
|
|
||||||
-i # --ignore-case
|
|
||||||
|
|
||||||
Synonyms:
|
|
||||||
|
|
||||||
egrep => grep -E
|
egrep => grep -E
|
||||||
fgrep => grep -F
|
fgrep => grep -F
|
||||||
|
|
73
sketch.md
73
sketch.md
|
@ -5,57 +5,64 @@ layout: default
|
||||||
|
|
||||||
### Insert
|
### Insert
|
||||||
|
|
||||||
- `V` vector
|
| `V` | vector |
|
||||||
- `P` pencil
|
| `P` | pencil |
|
||||||
- `T` text
|
| `T` | text |
|
||||||
- `L` line
|
| `L` | line |
|
||||||
- `R` rect
|
| `R` | rect |
|
||||||
- `O` oval
|
| `O` | oval |
|
||||||
- `U` rounded
|
| `U` | rounded |
|
||||||
|
{:.shortcuts}
|
||||||
|
|
||||||
### Show
|
### Show
|
||||||
|
|
||||||
- `^G` grid
|
| `^G` | grid |
|
||||||
- `^L` layout
|
| `^L` | layout |
|
||||||
- `^P` pixels
|
| `^P` | pixels |
|
||||||
- `^H` selection handles
|
| `^H` | selection handles |
|
||||||
- `^R` rulers
|
| `^R` | rulers |
|
||||||
|
{:.shortcuts}
|
||||||
|
|
||||||
### Sidebars
|
### Sidebars
|
||||||
|
|
||||||
- `⌘⌥1` toggle left (layers)
|
| `⌘⌥1` | toggle left (layers) |
|
||||||
- `⌘⌥2` toggle right (inspector)
|
| `⌘⌥2` | toggle right (inspector) |
|
||||||
- `⌘⌥3` toggle both
|
| `⌘⌥3` | toggle both |
|
||||||
- `⌘.` presentation
|
| `⌘.` | presentation |
|
||||||
|
{:.shortcuts}
|
||||||
|
|
||||||
### Zoom
|
### Zoom
|
||||||
|
|
||||||
- `⌘0` 100%
|
| `⌘0` | 100% |
|
||||||
- `⌘1` fit to screen
|
| `⌘1` | fit to screen |
|
||||||
- `⌘2` fit selection to screen
|
| `⌘2` | fit selection to screen |
|
||||||
- `⌘3` center selection
|
| `⌘3` | center selection |
|
||||||
|
{:.shortcuts}
|
||||||
|
|
||||||
### Arrange
|
### Arrange
|
||||||
|
|
||||||
- `⌘⌥ up/dn` forward or backward
|
| `⌘⌥ up/dn` | forward or backward |
|
||||||
- `^⌘⌥ up/dn` front or back
|
| `^⌘⌥ up/dn` | front or back |
|
||||||
|
{:.shortcuts}
|
||||||
|
|
||||||
### Distribute
|
### Distribute
|
||||||
|
|
||||||
- `^⌘H` horizontal
|
| `^⌘H` | horizontal |
|
||||||
- `^⌘V` vertical
|
| `^⌘V` | vertical |
|
||||||
|
{:.shortcuts}
|
||||||
|
|
||||||
### Layers
|
### Layers
|
||||||
|
|
||||||
- `⌘R` rename
|
| `⌘R` | rename |
|
||||||
- `⌘F` find
|
| `⌘F` | find |
|
||||||
|
| `⌘G` | group |
|
||||||
- `⌘G` group
|
| `⌘⇧G` | ungroup |
|
||||||
- `⌘⇧G` ungroup
|
{:.shortcuts}
|
||||||
|
|
||||||
### Font
|
### Font
|
||||||
|
|
||||||
- `⌘⌥ +/-` bigger/smaller
|
| `⌘⌥ +/-` | bigger/smaller |
|
||||||
- `⌘⇧[` left
|
| `⌘⇧[` | left align |
|
||||||
- `⌘⇧\` center
|
| `⌘⇧\` | center align |
|
||||||
- `⌘⇧]` right
|
| `⌘⇧]` | right align |
|
||||||
|
{:.shortcuts}
|
||||||
|
|
Loading…
Reference in New Issue