9817e1e7ff62494abf9d7c78870e92908567e8f4

Author
Gopal9816 <gopalkurup@gmail.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

common-aliases: add README (#8039)

Diff

This diff is truncated to protect this page.

  1diff --git a/plugins/common-aliases/README.md b/plugins/common-aliases/README.md
  2new file mode 100644
  3index 0000000000000000000000000000000000000000..d198a29ac97e980af91fbf0950ffcd3a7e2bc75b
  4--- /dev/null
  5+++ b/plugins/common-aliases/README.md
  6@@ -0,0 +1,121 @@
  7+# Common Aliases Plugin
  8+
  9+This plugin creates helpful shortcut aliases for many commonly used commands.
 10+
 11+To use it add `common-aliases` to the plugins array in your zshrc file:
 12+
 13+```zsh
 14+plugins=(... common-aliases)
 15+```
 16+
 17+## Aliases
 18+
 19+### ls command
 20+
 21+| Alias | Command       | Description                                                                    |
 22+|-------|---------------|--------------------------------------------------------------------------------|
 23+| l     | `ls -lFh`     | List files as a long list, show size, type, human-readable                     |
 24+| la    | `ls -lAFh`    | List almost all files as a long list show size, type, human-readable           |
 25+| lr    | `ls -tRFh`    | List files recursively sorted by date, show type, human-readable               |
 26+| lt    | `ls -ltFh`    | List files as a long list sorted by date, show type, human-readable            |
 27+| ll    | `ls -l`       | List files as a long list                                                      |
 28+| ldot  | `ls -ld .*`   | List dot files as a long list                                                  |
 29+| lS    | `ls -1FSsh`   | List files showing only size and name sorted by size                           |
 30+| lart  | `ls -1Fcart`  | List all files sorted in reverse of create/modification time (oldest first)    |
 31+| lrt   | `ls -1Fcrt`   | List files sorted in reverse of create/modification time(oldest first)         |
 32+
 33+### File handling
 34+
 35+| Alias | Command               | Description                                                                        |
 36+|-------|-----------------------|------------------------------------------------------------------------------------|
 37+| rm    | `rm -i`               | Remove a file                                                                      |
 38+| cp    | `cp -i`               | Copy a file                                                                        |
 39+| mv    | `mv -i`               | Move a file                                                                        |
 40+| zshrc | `${=EDITOR} ~/.zshrc` | Quickly access the ~/.zshrc file                                                   |
 41+| dud   | `du -d 1 -h`          | Display the size of files at depth 1 in current location in human-readable form    |
 42+| duf   | `du -sh`              | Display the size of files in current location in human-readable form               |
 43+| t     | `tail -f`             | Shorthand for tail which outputs the last part of a file                           |
 44+
 45+### find and grep
 46+
 47+| Alias | Command                                             | Description                             |
 48+|-------|-----------------------------------------------------|-----------------------------------------|
 49+| fd    | `find . -type d -name`                              | Find a directory with the given name    |
 50+| ff    | `find . -type f -name`                              | Find a file with the given name         |
 51+| grep  | `grep --color`                                      | Searches for a query string             |
 52+| sgrep | `grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS}`  | Useful for searching within files       |
 53+
 54+### Other Aliases
 55+
 56+| Alias     | Command             | Description                                                 |
 57+|-----------|---------------------|-------------------------------------------------------------|
 58+| h         | `history`           | Lists all recently used commands                            |
 59+| hgrep     | `fc -El 0 \| grep`  | Searches for a word in the list of previously used commands |
 60+| help      | `man`               | Opens up the man page for a command                         |
 61+| p         | `ps -f`             | Displays currently executing processes                      |
 62+| sortnr    | `sort -n -r`        | Used to sort the lines of a text file                       |
 63+| unexport  | `unset`             | Used to unset an environment variable                       |
 64+
 65+## Global aliases
 66+
 67+These aliases are expanded in any position in the command line, meaning you can use them even at the
 68+end of the command you've typed. Examples:
 69+
 70+Quickly pipe to less:
 71+```zsh
 72+$ ls -l /var/log L
 73+# will run
 74+$ ls -l /var/log | less
 75+```
 76+Silences stderr output:
 77+```zsh
 78+$ find . -type f NE
 79+# will run
 80+$ find . -type f 2>/dev/null
 81+```
 82+
 83+| Alias | Command                     | Description                                                 |
 84+|-------|-----------------------------|-------------------------------------------------------------| 
 85+| H     | `\| head`                   | Pipes output to head which outputs the first part of a file |
 86+| T     | `\| tail`                   | Pipes output to tail which outputs the last part of a file  |
 87+| G     | `\| grep`                   | Pipes output to grep to search for some word                |
 88+| L     | `\| less`                   | Pipes output to less, useful for paging                     |
 89+| M     | `\| most`                   | Pipes output to more, useful for paging                     |
 90+| LL    | `2>&1 \| less`              | Writes stderr to stdout and passes it to less               |
 91+| CA    | `2>&1 \| cat -A`            | Writes stderr to stdout and passes it to cat                |
 92+| NE    | `2 > /dev/null`             | Silences stderr                                             |
 93+| NUL   | `> /dev/null 2>&1`          | Silences both stdout and stderr                             |
 94+| P     | `2>&1\| pygmentize -l pytb` | Writes stderr to stdout and passes it to pygmentize         |
 95+
 96+## File extension aliases
 97+
 98+These are special aliases that are triggered when a file name is passed as the command. For example,
 99+if the pdf file extension is aliased to `acroread` (a popular Linux pdf reader), when running `file.pdf`
100+that file will be open with `acroread`.
101+
102+### Reading Docs
103+
104+| Alias | Command     | Description                         |
105+|-------|-------------|-------------------------------------|