Merge branch 'master' into lsof_add_some_options_example

waldyrious/alt-syntax
Yoshinari Takaoka 2016-01-10 21:37:46 +09:00
commit dc91102205
297 changed files with 1887 additions and 1304 deletions

View File

@ -7,16 +7,16 @@ Contribution are most welcome! All `tldr` pages are stored in Markdown right her
## Guidelines
Note that `tldr` is focused on concrete examples.
Here's a few guidelines to get started:
Here are a few guidelines to get started:
1. Focus on the 5 or 6 most common usages. It's OK if the page doesn't cover everything; that's what `man` is for.
2. When in doubt, keep new command-line users in mind. Err on the side of clarity rather than terseness.
3. Try to incorporate the spelled-out version of single-letter options in the example's description.
4. Introduce options gradually, starting with the simplest commands and using more complex examples progressively.
5. Use short but descriptive values for the tokens, ex. `{{source_file}}` or `{{wallet.txt}}`.
6. Be specific: avoid explaining general UNIX concepts that could apply to any command (ex: relative/absolute paths, brace expansion, character escaping...)
6. Be specific: avoid explaining general UNIX concepts that could apply to any command (ex: relative/absolute paths, brace expansion, character escaping...).
The best way to be consistent is to have a look at a few existing pages :)
The best way to be consistent is to have a look at a few existing pages :).
## Markdown format
@ -25,21 +25,36 @@ The format of each page should match the following:
```
# command-name
> Short description
> Max 1 or 2 lines
> Short, snappy description.
> Preferably one line; two are acceptable if necessary.
- example description
- Example description:
`command -opt1 -opt2 -arg1 {{arg_value}}`
- example description
- Example description:
`command -opt1 -opt2`
```
User-provided values should use the `{{token}}` syntax, to allow clients to highlight them. For example: `tar cf {{file}}`
### Token Syntax
User-provided values should use the `{{token}}` syntax in order to allow clients
to highlight them.
One of the reasons for this format is that it's well suited for command-line clients that need to extract a single description/example.
Some examples:
- `tar cf {{file}}`
- `ln -s {{path/to/original/file}} {{path/to/link}}`
- `mysql {{database_name}}`
- `unrar x {{compressed.rar}}`
In short, make it as intuitive as possible for the user to figure out
how to use the command and fill it in with values.
Stick to [`snake_case`](https://en.wikipedia.org/wiki/Snake_case) where possible.
In some situations a command works with typical file extensions
(like the `unrar` example above); you are encouraged to add these for demonstration.
One of the reasons for this format is that it's well suited for command-line
clients that need to extract a single description/example.
## Submitting a pull request
@ -82,7 +97,7 @@ Detailed explanation:
git checkout -b <topic-branch-name>
```
5. Run `make lint` to check that your page(s) are correct.
5. Run `make lint` to check that your page(s) are correct. Try to run the commands you are describing to ensure the syntax is correct.
6. Please use the following commit message format:
`<command>: type of change`.
@ -102,15 +117,31 @@ Detailed explanation:
8. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
with a clear title and description.
If page is not about a standard Unix/Linux tool, please include a link to the tool home page.
If you are changing something non-trivial, not just adding a page for a new tool, please describe why you are doing this.
9. Use Git's
[interactive rebase](https://help.github.com/articles/interactive-rebase)
feature to tidy up your commits before making them public.
If you are not familiar with `git rebase`, it might be helpful to check out these video tutorials:
- [Git Rebase: squash last commits](https://www.youtube.com/watch?v=qh9KtjfjzCU)
- [Learning Git Tutorial: Interactive Rebasing](https://www.youtube.com/watch?v=NW46XmvJh5Q)
In most cases it is better to squash commits before submitting a pull request.
10. If you are asked to amend your changes before they can be merged in, please
use `git commit --amend` and force push to your remote feature branch.
You may also be asked to squash commits.
10. If you do not want to do a rebasing, you can overwrite your last commit in pull request, while you have only a single commit. You can achieve this with `git commit --amend` command.
```bash
# When you are on topic branch of your pull request
# Fix your files
git add . # Register edited files
git commit --amend # Do amended commit
git push --force # Overwrite your branch
```
## Licensing

View File

@ -1,6 +0,0 @@
Romain Prieto <romain.prieto@gmail.com> (@rprieto)
Igor Shubovych <igor.shubovych@gmail.com> (@igorshubovych)
Ruben Vereecken <rubenvereecken@gmail.com> (@rubenvereecken)
Waldir Pimenta <waldyrious@gmail.com> (@waldyrious)
Felix Yan <felixonmars@archlinux.org> (@felixonmars)
Leandro Ostera <leandro@ostera.io> (@ostera)

View File

@ -47,17 +47,23 @@ You can access these pages on your computer using one of the following clients:
- [Go client](https://github.com/pranavraja/tldr): `go get github.com/pranavraja/tldr`
(or [platform binaries](https://github.com/pranavraja/tldr/releases))
- [Elixir client](https://github.com/tldr-pages/tldr_elixir_client) (binaries not yet available)
- [C++ client](https://github.com/tldr-pages/tldr-cpp-client): `brew tap tldr-pages/tldr && brew install tldr`
- [C++ client](https://github.com/tldr-pages/tldr-cpp-client): `brew install tldr-pages/tldr/tldr`
- Android clients:
- [tldr-viewer](https://github.com/gianasista/tldr-viewer), available on
[Google Play](https://play.google.com/store/apps/details?id=de.gianasista.tldr_viewer)
- [tldroid](https://github.com/hidroh/tldroid), available on
[Google Play](https://play.google.com/store/apps/details?id=io.github.hidroh.tldroid)
- [Ruby client](https://github.com/YellowApple/tldrb): `gem install tldrb`
- [Rust client](https://github.com/rilut/rust-tldr): `cargo install tldr`
- Rust clients:
- [rust-tldr](https://github.com/rilut/rust-tldr) (online lookup): `cargo install tldr`
- [tldr-rs](https://github.com/dbrgn/tldr-rs) (offline caching, not yet published)
- [R client](https://github.com/kirillseva/tldrrr): `devtools::install_github('kirillseva/tldrrr')`
- [Dart client](https://github.com/hterkelsen/tldr): `pub global activate tldr`
- [Web client](https://github.com/ostera/tldr.jsx): https://ostera.github.io/tldr.jsx
- [Perl5 client](https://github.com/shoichikaji/perl-tldr): `cpanm App::tldr`
- [Emacs client](https://github.com/kuanyui/tldr.el)
- [Bash client](https://github.com/raylee/tldr)
- [Crystal client](https://github.com/porras/tlcr): `brew install porras/tap/tlcr`
Let us know if you are building one and we can add it to this list!
@ -69,3 +75,9 @@ Let us know if you are building one and we can add it to this list!
Contributions are most welcome!
Have a look at the [contributing guidelines](https://github.com/tldr-pages/tldr/blob/master/CONTRIBUTING.md)
and go ahead!
## Similar projects
- [Cheat](https://github.com/chrisallenlane/cheat) allows you to create and view interactive cheatsheets on the command-line. It was designed to help remind *nix system administrators of options for commands that they use frequently, but not frequently enough to remember.
- [Bro pages](http://bropages.org/) are a highly readable supplement to man pages. Bro pages show concise, common-case examples for Unix commands.

19
pages/common/7za.md Normal file
View File

@ -0,0 +1,19 @@
# 7za
> A file archiver with high compression ratio.
- Compress directory or file:
`7za a {{compressed.7z}} {{directory_or_file_to_compress}}`
- Decompress an existing 7z file with original directory structure:
`7za x {{compressed.7z}}`
- Compress to zip format:
`7za a -tzip {{compressed.zip}} {{directory_or_file_to_compress}}`
- Create multipart 7zip file; `part_size` specifies part size in Bytes, Kilobytes, Megabytes or Gigabytes:
`7za -v{{part_size}}{{[b|k|m|g]}} {{compressed.7z}} {{directory_or_file_to_compress}}`

View File

@ -2,10 +2,10 @@
> Apache Benchmarking tool. The simplest tool to perform a load testing.
- Execute 100 HTTP GET requests to given URL.
- Execute 100 HTTP GET requests to given URL:
`ab -n 100 {{url}}`
- Execute 100 HTTP GET requests, processing up to 10 requests concurrently, to given URL.
- Execute 100 HTTP GET requests, processing up to 10 requests concurrently, to given URL:
`ab -n 100 -c 10 {{url}}`

View File

@ -2,18 +2,18 @@
> A search tool like grep, optimized for programmers.
- Find files containing "foo"
- Find files containing "foo":
`ack {{foo}}`
- Find files in a specific language
- Find files in a specific language:
`ack --ruby {{each_with_object}}`
- Count the total number of matches for the term "foo"
- Count the total number of matches for the term "foo":
`ack -ch {{foo}}`
- Show the file names containing "foo" and number of matches in each file
- Show the file names containing "foo" and number of matches in each file:
`ack -cl {{foo}}`

19
pages/common/adb.md Normal file
View File

@ -0,0 +1,19 @@
# Android Debug Bridge
> Communicate with an Android emulator instance or connected Android devices.
- Check whether the adb server process is running and start it:
`adb start-server`
- Terminate the adb server process:
`adb kill-server`
- Start a remote shell in the target emulator/device instance:
`adb shell`
- Push an Android application to an emulator/device:
`adb install -r {{apk.path}}`

View File

@ -2,11 +2,11 @@
> The Silver Searcher. Like ack, but faster.
- Find files containing "foo"
- Find files containing "foo":
`ag foo`
- Find "foo" in files with a name matching "bar"
- Find "foo" in files with a name matching "bar":
`ag foo -G bar`
@ -14,6 +14,6 @@
`ag '^ba(r|z)$'`
- Find files with a name matching "foo"
- Find files with a name matching "foo":
`ag -g foo`

View File

@ -1,24 +1,24 @@
# alias
> Creates an alias for a word when used
> as the first word of a command
> Creates an alias for a word when used.
> As the first word of a command.
- creating a generic alias
- Creating a generic alias:
`alias {{word}}="{{command}}"`
- remove an aliased command
- Remove an aliased command:
`unalias {{word}}`
- full list of aliased words
- Full list of aliased words:
`alias -p`
- turning rm an interative command
- Turning rm an interative command:
`alias {{rm}}="{{rm -i}}"`
- overriding la as ls -a
- Overriding la as ls -a:
`alias {{la}}="{{ls -a}}"`

View File

@ -1,12 +1,12 @@
# apropos
> Search in manpages
> for example to find a new command
> Search in manpages.
> For example to find a new command.
- search for keyword
- Search for keyword:
`apropos {{regular_expression}}`
- search without restricting output to terminal width
- Search without restricting output to terminal width:
`apropos -l {{regular_expression}}`

View File

@ -1,23 +1,23 @@
# ar
> Create, modify, and extract from archives (.a .so .o)
> Create, modify, and extract from archives (.a .so .o).
- Extract all members from an archive
- Extract all members from an archive:
`ar -x {{libfoo.a}}`
- List the members of an archive
- List the members of an archive:
`ar -t {{libfoo.a}}`
- Replace or add files to an archive
- Replace or add files to an archive:
`ar -r {{libfoo.a}} {{foo.o}} {{bar.o}} {{baz.o}}`
- Insert an object file index (equivalent to using `ranlib`)
- Insert an object file index (equivalent to using `ranlib`):
`ar -s {{libfoo.a}}`
- Create an archive with files and an accompanying object file index
- Create an archive with files and an accompanying object file index:
`ar -rs {{libfoo.a}} {{foo.o}} {{bar.o}} {{baz.o}}`

20
pages/common/autojump.md Normal file
View File

@ -0,0 +1,20 @@
# autojump
> Quickly jump among the directories you visit the most.
> Aliases like j or jc are provided for even less typing.
- Jump to a directory that contains the given pattern.
`j {{pattern}}`
- Jump to a sub-directory (child) of the current directory that contains the given pattern.
`jc {{pattern}}`
- Remove non-existing directories from the autojump database.
`j --purge`
- Show the entries in the autojump database.
`j -s`

View File

@ -1,19 +1,19 @@
# awk
> A versatile programming language for working on files
> A versatile programming language for working on files.
- Print the fifth column in a space separated file
- Print the fifth column in a space separated file:
`awk '{print $5}' {{filename}}`
- Print the third column in a comma separated file
- Print the third column in a comma separated file:
`awk -F ',' '{print $3}' {{filename}}`
- Sum the values in the first column and print the total
- Sum the values in the first column and print the total:
`awk '{s+=$1} END {print s}' {{filename}}`
- Sum the values in the first column and pretty-print the values and then the total
- Sum the values in the first column and pretty-print the values and then the total:
`awk '{s+=$1; print $1} END {print "--------"; print s}' {{filename}}`

20
pages/common/bash.md Normal file
View File

@ -0,0 +1,20 @@
# bash
> Bourne-Again SHell.
> `sh`-compatible command line interpreter.
- Start interactive command line interpreter:
`bash`
- Execute command passed as parameter:
`bash -c {{command}}`
- Run commands from file (script):
`bash {{file}}`
- Run commands from file and print them as they are executed:
`bash -x {{file}}`

View File

@ -2,22 +2,22 @@
> Save and jump to commonly used directories using 1 character commands.
- List available bookmarks
- List available bookmarks:
`l`
- Save the current folder as "bookmark_name"
- Save the current folder as "bookmark_name":
`s {{bookmark_name}}`
- Go to a bookmarked folder
- Go to a bookmarked folder:
`g {{bookmark_name}}`
- Print a bookmarked folder's contents
- Print a bookmarked folder's contents:
`p {{bookmark_name}}`
- Delete a bookmark
- Delete a bookmark:
`d {{bookmark_name}}`

View File

@ -2,18 +2,18 @@
> Calculator.
- Run calculator in interactive mode
- Run calculator in interactive mode:
`bc -i`
- Calculate the result of an expression
- Calculate the result of an expression:
`bc <<< "(1 + 2) * 2 ^ 2"`
- Calculate with the given precision
- Calculate with the given precision:
`bc <<< "scale=10; 5 / 3"`
- Calculate expression with sine and cosine using mathlib
- Calculate expression with sine and cosine using mathlib:
`bc -l <<< "s(1) + c(1)"`

19
pages/common/bmaptool.md Normal file
View File

@ -0,0 +1,19 @@
# bmaptool
> Create or Copy blockmaps intelligently (and therefore faster than `cp` or `dd`).
- Create a blockmap from image file.
`bmaptool create -o {{blockmap.bmap}} {{source.img}}`
- Copy an image file into sdb.
`bmaptool copy --bmap {{blockmap.bmap}} {{source.img}} {{/dev/sdb}}`
- Copy a compressed image file into sdb.
`bmaptool copy --bmap {{blockmap.bmap}} {{source.img.gz}} {{/dev/sdb}}`
- Copy an image file into sdb without using a blockmap.
`bmaptool copy --nobmap {{source.img}} {{/dev/sdb}}`

View File

@ -2,18 +2,18 @@
> Dependency manager for the Ruby programming language.
- Installs all gems defined in the gemfile expected in the working directory.
- Installs all gems defined in the gemfile expected in the working directory:
`bundle install`
- Update all gems by the rules defined in the gemfile and regenerate gemfile.lock
- Update all gems by the rules defined in the gemfile and regenerate gemfile.lock:
`bundle update`
- Update one specific gem defined in the gemfile
- Update one specific gem defined in the gemfile:
`bundle update --source {{gemname}}`
- Create a new gem skeleton
- Create a new gem skeleton:
`bundle gem {{gemname}}`

View File

@ -1,23 +1,19 @@
# cal
> Prints calendar information
> Prints calendar information.
- Display a calendar for the current month or specified month
- Display a calendar for the current month or specified month:
`cal`
`cal -m {{12}}`
`cal -m {{Dec}}`
- Display a calendar for the current year or a specified year
- Display a calendar for the current year or a specified year:
`cal -y`
`cal 2013`
- Display date of Easter (western churches)
- Display date of Easter (western churches):
`ncal -e`
`ncal -e 2013`

View File

@ -4,14 +4,14 @@
> Ebooks must be imported into the library using the GUI or calibredb before.
> Part of the Calibre ebook library.
- Start a server to distribute ebooks. Access at http://localhost:8080
- Start a server to distribute ebooks. Access at http://localhost:8080:
`calibre-server`
- Start server on different port. Access at http://localhost:port
- Start server on different port. Access at http://localhost:port:
`calibre-server --port {{port}}`
- Password protect the server.
- Password protect the server:
`calibre-server --username {{username}} --password {{password}}`

View File

@ -3,22 +3,22 @@
> Tool to manipulate the your ebook database.
> Part of the Calibre ebook library.
- List ebooks in the library with additional information.
- List ebooks in the library with additional information:
`calibredb list`
- Search for ebooks displaying additional information.
- Search for ebooks displaying additional information:
`calibredb list --search {{search-term}}`
- Search for just ids of ebooks.
- Search for just ids of ebooks:
`calibredb search {{search term}}`
- Add one or more ebooks to the library.
- Add one or more ebooks to the library:
`calibredb add {{file1 file2 …}}`
- Remove one or more ebooks from the library. You need ebook-ids (see above)
- Remove one or more ebooks from the library. You need ebook-ids (see above):
`calibredb remove {{id1 id2 …}}`

View File

@ -2,14 +2,14 @@
> Print and concatenate files.
- Print the contents of a file to the standard output
- Print the contents of a file to the standard output:
`cat {{file}}`
- Concatenate several files into the target file.
- Concatenate several files into the target file:
`cat {{file1}} {{file2}} > {{target-file}}`
- Append serveral files into the target file.
- Append serveral files into the target file:
`cat {{file1}} {{file2}} >> {{target-file}}`

View File

@ -1,19 +1,19 @@
# cd
> Change the current working directory
> Change the current working directory.
- Go to the given directory
- Go to the given directory:
`cd {{/path/to/directory}}`
- Go to home directory of current user
- Go to home directory of current user:
`cd`
- Go up to the parent of the current directory
- Go up to the parent of the current directory:
`cd ..`
- Go to the previously chosen directory
- Go to the previously chosen directory:
`cd -`

View File

@ -1,23 +1,23 @@
# chmod
> Change the access permissions of a file or directory
> Change the access permissions of a file or directory.
- Give the (u)ser who owns a file the right to e(x)ecute it
- Give the (u)ser who owns a file the right to e(x)ecute it:
`chmod u+x {{file}}`
- Give the user rights to (r)ead and (w)rite to a file/directory
- Give the user rights to (r)ead and (w)rite to a file/directory:
`chmod u+rw {{file}}`
- Remove executable rights from the (g)roup
- Remove executable rights from the (g)roup:
`chmod g-x {{file}}`
- Give (a)ll users rights to read and execute
- Give (a)ll users rights to read and execute:
`chmod a+rx {{file}}`
- Give (o)thers (not in the file owner's group) the same rights as the group
- Give (o)thers (not in the file owner's group) the same rights as the group:
`chmod o=g {{file}}`

View File

@ -1,23 +1,23 @@
# chown
> Change the owning user/group of the specified files
> Change the owning user/group of the specified files.
- change the user of a file
- Change the user of a file:
`chown {{user}} {{path/to/file}}`
- change the user and group of a file
- Change the user and group of a file:
`chown {{user}}:{{group}} {{path/to/file}}`
- recursively change the owner of an entire folder
- Recursively change the owner of an entire folder:
`chown -R {{user}} {{path/to/folder}}`
- change the owner of a symbolic link
- Change the owner of a symbolic link:
`chown -h {{user}} {{path/to/symlink}}`
- use the owner and group of a reference file and apply those values to another file
- Use the owner and group of a reference file and apply those values to another file:
`chown --reference={{reference-file}} {{path/to/file}}`

View File

@ -1,7 +1,7 @@
# chsh
> Change user's login shell
> Change user's login shell.
- change shell
- Change shell:
`chsh -s {{path/to/shell_binary}} {{username}}`

View File

@ -1,8 +1,8 @@
# cksum
> Calculates CRC checksums and byte counts of a file
> Calculates CRC checksums and byte counts of a file.
> Note, on old UNIX systems the CRC implementation may differ.
- Display a 32 bit checksum, size in bytes and filename
- Display a 32 bit checksum, size in bytes and filename:
`cksum {{filename}}`

View File

@ -2,14 +2,14 @@
> Compiler for C, C++, and Objective-C source files. Can be used as a drop-in replacement for GCC.
- Compile a source code file into an executable binary
- Compile a source code file into an executable binary:
`clang {{input_source.c}} -o {{output_executable}}`
- Activate output of all errors and warnings
- Activate output of all errors and warnings:
`clang {{input_source.c}} -Wall -o {{output_executable}}`
- Include libraries located at a different path than the source file
- Include libraries located at a different path than the source file:
`clang {{input_source.c}} -o {{output_executable}} -I{{header_path}} -L{{library_path}} -l{{library_name}}`

View File

@ -2,22 +2,22 @@
> Select or reject lines common to two files. Both files must be sorted.
- Produce three tab-separated columns: lines only in first file, lines only in second file and common lines.
- Produce three tab-separated columns: lines only in first file, lines only in second file and common lines:
`comm {{file1}} {{file2}}`
- Print only lines common to both files.
- Print only lines common to both files:
`comm -12 {{file1}} {{file2}}`
- Print only lines common to both files, read one file from stdin.
- Print only lines common to both files, read one file from stdin:
`cat {{file1}} | comm -12 - {{file2}}`
- Print lines only found in first file.
- Print lines only found in first file:
`comm -23 {{file1}} {{file2}}`
- Print lines only found in second file.
- Print lines only found in second file:
`comm -13 {{file1}} {{file2}}`

View File

@ -1,19 +1,19 @@
# convert
> Imagemagick image conversion tool
> Imagemagick image conversion tool.
- Convert an image from JPG to PNG
- Convert an image from JPG to PNG:
`convert {{image.jpg}} {{image.png}}`
- Scale an image 50% it's original size
- Scale an image 50% it's original size:
`convert {{image.png}} -resize 50% {{image2.png}}`
- Scale an image keeping the original aspect ratio to a maximum dimension of 640x480.
- Scale an image keeping the original aspect ratio to a maximum dimension of 640x480:
`convert {{image.png}} -resize 640x480 {{image2.png}}`
- Horizontally append images
- Horizontally append images:
`convert {{image1.png}} {{image2.png}} {{image3.png}} +append {{image123.png}}`

View File

@ -1,27 +1,27 @@
# cordova
> Mobile apps with HTML, CSS & JS
> Mobile apps with HTML, CSS & JS.
- Create a cordova project
- Create a cordova project:
`cordova create {{path}} {{package.name}} {{project.name}}`
- Display the current workspace status
- Display the current workspace status:
`cordova info`
- Add a cordova platform
- Add a cordova platform:
`cordova platform add {{platform}}`
- Remove a cordova platform
- Remove a cordova platform:
`cordova platform remove {{platform}}`
- Add a cordova plugin
- Add a cordova plugin:
`cordova plugin add {{pluginid}}`
- Remove a cordova plugin
- Remove a cordova plugin:
`cordova plugin remove {{pluginid}}`

View File

@ -1,15 +1,15 @@
# cowsay
> Generate an ASCII character like a cow or sheep saying or thinking something
> Generate an ASCII character like a cow or sheep saying or thinking something.
- Print an ASCII cow saying "Hello world!"
- Print an ASCII cow saying "Hello world!":
`cowsay "Hello world!"`
- Print an ASCII dragon saying "Hello!"
- Print an ASCII dragon saying "Hello!":
`echo "Hello!" | cowsay -f dragon`
- Print a stoned thinking ASCII cow
- Print a stoned thinking ASCII cow:
`cowthink -s "I'm just a cow, not a great thinker ..."`

View File

@ -1,27 +1,27 @@
# cp
> Copy files
> Copy files.
- Copy files in arbitrary locations
- Copy files in arbitrary locations:
`cp {{/path/to/original}} {{/path/to/copy}}`
- Copy a file to a parent directory
- Copy a file to a parent directory:
`cp {{/path/to/original}} ../{{path/to/copy}}`
- Copy directories recursive using the option -r
- Copy directories recursive using the option -r:
`cp -r {{/path/to/original}} {{/path/to/copy}}`
- Show files as they are copied
- Show files as they are copied:
`cp -vr {{/path/to/original}} {{/path/to/copy}}`
- Make a copy of a file, adding an extension
- Make a copy of a file, adding an extension:
`cp {{file.html}}{,.backup}`
- Make a copy of a file, changing the extension
- Make a copy of a file, changing the extension:
`cp {{file.}}{html,backup}`

View File

@ -1,28 +1,28 @@
# curl
> Transfers data from or to a server
> Supports most protocols including HTTP, FTP, POP
> Transfers data from or to a server.
> Supports most protocols including HTTP, FTP, POP.
- Download a URL to a file
- Download a URL to a file:
`curl "{{URL}}" -o filename`
`curl "{{URL}}" -o {{filename}}`
- send form-encoded data
- Send form-encoded data:
`curl --data {{name=bob}} {{http://localhost/form}}`
- send JSON data
- Send JSON data:
`curl -X POST -H "Content-Type: application/json" -d {{'{"name":"bob"}'}} {{http://localhost/login}}`
- specify an HTTP method
- Specify an HTTP method:
`curl -X {{DELETE}} {{http://localhost/item/123}}`
- head request
- Head request:
`curl --head {{http://localhost}}`
- pass a user name and password for server authentication
- Pass a user name and password for server authentication:
`curl -u myusername:mypassword {{http://localhost}}`

View File

@ -1,27 +1,27 @@
# cut
> Cut out fields from STDIN or files
> Cut out fields from STDIN or files.
- Cut out the first sixteen characters of each line of STDIN
- Cut out the first sixteen characters of each line of STDIN:
`cut -c {{1-16}}`
- Cut out the first sixteen characters of each line of the given files
- Cut out the first sixteen characters of each line of the given files:
`cut -c {{1-16}} {{file}}`
- Cut out everything from the 3rd character to the end of each line
- Cut out everything from the 3rd character to the end of each line:
`cut -c{{3-}}`
- Cut out the fifth field, split on the colon character of each line
- Cut out the fifth field, split on the colon character of each line:
`cut -d'{{:}}' -f{{5}}`
- Cut out the fields five and 10, split on the colon character of each line
- Cut out the fields five and 10, split on the colon character of each line:
`cut -d'{{:}}' -f{{5,10}}`
- Cut out the fields five through 10, split on the colon character of each line
- Cut out the fields five through 10, split on the colon character of each line:
`cut -d'{{:}}' -f{{5-10}}`

View File

@ -1,11 +1,11 @@
# date
> Set or display the system date
> Set or display the system date.
- Display the date using the default locale
- Display the date using the default locale:
`date +"%c"`
- Display the date in UTC and ISO 8601 format
- Display the date in UTC and ISO 8601 format:
`date -u +"%Y-%m-%dT%H:%M:%SZ"`

View File

@ -1,15 +1,15 @@
# deluser
> Remove a user account or remove a user from a group
> Remove a user account or remove a user from a group.
- Remove a user
- Remove a user:
`deluser {{name}}`
- Remove a user along with their home directory and mail spool
- Remove a user along with their home directory and mail spool:
`deluser -r {{name}}`
- Remove a user from a group
- Remove a user from a group:
`deluser {{name}} {{group}}`

View File

@ -1,11 +1,11 @@
# df
> gives an overview of the file system disk space usage
> Gives an overview of the file system disk space usage.
- display all file systems and their disk usage
- Display all file systems and their disk usage:
`df`
- display all file systems and their disk usage in human readable form
- Display all file systems and their disk usage in human readable form:
`df -h`

View File

@ -1,23 +1,23 @@
# diff
> Compare files and directories
> Compare files and directories.
- Compare files
- Compare files:
`diff {{file1}} {{file2}}`
- Compare files, ignoring white spaces
- Compare files, ignoring white spaces:
`diff -w {{file1}} {{file2}}`
- Compare files, showing differences side by side
- Compare files, showing differences side by side:
`diff -y {{file1}} {{file2}}`
- Compare directories recursively
- Compare directories recursively:
`diff -r {{directory1}} {{directory2}}`
- Compare directories, only showing the names of files that differ
- Compare directories, only showing the names of files that differ:
`diff -rq {{directory1}} {{directory2}}`

View File

@ -1,15 +1,15 @@
# dig
> DNS Lookup utility
> DNS Lookup utility.
- Lookup the IP(s) associated with a hostname (A records)
- Lookup the IP(s) associated with a hostname (A records):
`dig +short {{hostname.com}}`
- Lookup the mail server associated with a given domain name (MX record)
- Lookup the mail server associated with a given domain name (MX record):
`dig +short {{hostname.com}} MX`
- Specify an alternate DNS server to query (8.8.8.8 is google's public DNS)
- Specify an alternate DNS server to query (8.8.8.8 is google's public DNS):
`dig @8.8.8.8 {{hostname.com}}`

View File

@ -1,20 +1,28 @@
# docker
> Docker allows you to package an application with all of its
> dependencies into a standardized unit for software development.
> Docker allows you to package an application with all of its.
> Dependencies into a standardized unit for software development.
- List of running docker containers
- List of running docker containers:
`docker ps`
- List all docker containers (running and stopped)
- List all docker containers (running and stopped):
`docker ps -a`
- Start a container
- Start a container:
`docker start {{container}}`
- Stop a container
- Stop a container:
`docker stop {{container}}`
- Start a container from an image and get a shell inside of it:
`docker run -it {{image}} bash`
- Run a command inside of an already running container:
`docker exec {{container}} {{command}}`

24
pages/common/dokku.md Normal file
View File

@ -0,0 +1,24 @@
# Dokku
> Docker powered mini-Heroku (PaaS).
> Easily deploy multiple apps to your server in different languages using a single `git-push` command.
- List runinng apps:
`dokku apps`
- Create an app:
`dokku apps:create {{app_name}}`
- Remove an app:
`dokku apps:destroy {{app_name}}`
- Install plugin:
`dokku plugin:install {{full_repo_url}}`
- Link database to an app:
`dokku {{db}}:link {{db_name}} {{app_name}}`

View File

@ -2,26 +2,26 @@
> A command-line shell and scripting interface for Drupal.
- Download module "foo"
- Download module "foo":
`drush dl {{foo}}`
- Download version 7.x-2.1-beta1 of module "foo"
- Download version 7.x-2.1-beta1 of module "foo":
`drush dl {{foo}}-7.x-2.1-beta1`
- Enable module "foo"
- Enable module "foo":
`drush en {{foo}}`
- Disable module "foo"
- Disable module "foo":
`drush dis {{foo}}`
- Clear all caches
- Clear all caches:
`drush cc all`
- Clear CSS and JavaScript caches
- Clear CSS and JavaScript caches:
`drush cc css-js`

View File

@ -3,6 +3,6 @@
> Can be used to convert ebooks between common formats, e.g., pdf, epub and mobi.
> Part of the Calibre ebook library tool.
- Convert an ebook into another format.
- Convert an ebook into another format:
`ebook-convert {{source}} {{destination}}`

View File

@ -1,11 +1,11 @@
# echo
> Print given arguments
> Print given arguments.
- Print a text message. Note: quotes are optional.
- Print a text message. Note: quotes are optional:
`echo {{"Hello World"}}`
- Print a message with environment variables
- Print a message with environment variables:
`echo {{"My path is $PATH"}}`

View File

@ -1,31 +1,31 @@
# electrum
> Ergonomic Bitcoin wallet and private key management
> Ergonomic Bitcoin wallet and private key management.
- Create a new wallet
- Create a new wallet:
`electrum -w {{new-wallet.dat}} create`
- Restore an existing wallet from seed offline
- Restore an existing wallet from seed offline:
`electrum -w {{recovery-wallet.dat}} restore -o`
- Create a signed transaction offline
- Create a signed transaction offline:
`electrum mktx {{recipient}} {{amount}} -f 0.0000001 -F {{from}} -o`
- Display all wallet receiving addresses
- Display all wallet receiving addresses:
`electrum listaddresses -a`
- Sign a message
- Sign a message:
`electrum signmessage {{address}} {{message}}`
- Verify a message
- Verify a message:
`electrum verifymessage {{address}} {{signature}} {{message}}`
- Connect only to a specific electrum-server instance
- Connect only to a specific electrum-server instance:
`electrum -p socks5:{{127.0.0.1}}:9050 -s {{56ckl5obj37gypcu.onion}}:50001:t -1`

View File

@ -1,15 +1,15 @@
# emacs
> The extensible, customizable, self-documenting, real-time display editor
> The extensible, customizable, self-documenting, real-time display editor.
- Open emacs in console mode (without X window)
- Open emacs in console mode (without X window):
`emacs -nw`
- Open a file in emacs
- Open a file in emacs:
`emacs {{filename}}`
- Exit emacs
- Exit emacs:
`C-x C-c`

19
pages/common/enca.md Normal file
View File

@ -0,0 +1,19 @@
# enca
> Detect and convert encoding of text files.
- Detect file(s) encoding according to your system's locale:
`enca {{file(s)}}`
- Detect file(s) encoding; -L option tells enca the current language; language is in the POSIX/C locale format, e.g. zh_CN, en_US etc:
`enca -L {{language}} {{file(s)}}`
- Convert file(s) to specified encoding:
`enca -L {{language}} -x {{to_encoding}} {{file(s)}}`
- Save original_file as new_file and convert new_file to specified encoding:
`enca -L {{language}} -x {{to_encoding}} < {{original_file}} > {{new_file}}`

View File

@ -1,19 +1,19 @@
# env
> Show the environment or run a program in a modified environment
> Show the environment or run a program in a modified environment.
- Show the environment
- Show the environment:
`env`
- Clear the environment and run a program
- Clear the environment and run a program:
`env -i {{program}}`
- Remove variable from the environment and run a program
- Remove variable from the environment and run a program:
`env -u {{variable}} {{program}}`
- Set a variable and run a program
- Set a variable and run a program:
`env {{variable}}={{value}} {{program}}`

View File

@ -1,7 +1,7 @@
# exiftool
> Read and write meta information in files
> Read and write meta information in files.
- Remove all EXIF metadata from the given files
- Remove all EXIF metadata from the given files:
`exiftool -All= {{file}}`

View File

@ -1,20 +1,20 @@
# fdupes
> Finds duplicate files in a given
> set of directories
> Finds duplicate files in a given.
> Set of directories.
- search a single directory
- Search a single directory:
`fdupes {{directory}}`
- search multiple directories
- Search multiple directories:
`fdupes {{directory1}} {{directory2}}`
- search all directories recursively
- Search all directories recursively:
`fdupes -r {{directory}}`
- search multiple directories, one recursively
- Search multiple directories, one recursively:
`fdupes {{directory1}} -R {{directory2}}`

View File

@ -1,19 +1,19 @@
# ffmpeg
> Video conversion tool
> Video conversion tool.
- Extract the sound from a video and save it as MP3
- Extract the sound from a video and save it as MP3:
`ffmpeg -i {{video-filename}} -vn -ar 44100 -ac 2 -ab 192 -f mp3 {{sound.mp3}}`
- Convert frames from a video into individual numbered images
- Convert frames from a video into individual numbered images:
`ffmpeg -i {{video-filename}} {{image%d.png}}`
- Combine numbered images (image1.jpg, image2.jpg, etc) into a video
- Combine numbered images (image1.jpg, image2.jpg, etc) into a video:
`ffmpeg -f image2 -i {{image%d.jpg}} {{video.mpg}}`
- Convert AVI video to MP4. AAC Audio @ 128kbit, Video @ 1250Kbit
- Convert AVI video to MP4. AAC Audio @ 128kbit, Video @ 1250Kbit:
`ffmpeg -i {{in.avi}} -acodec libfaac -ab 128k -vcodec mpeg4 -b 1250K {{out.mp4}}`

View File

@ -1,11 +1,19 @@
# file
> Determine file type
> Determine file type.
- Give a description of the type of the specified file. Works fine for files with no file extension.
- Give a description of the type of the specified file. Works fine for files with no file extension:
`file {{filename}}`
- Look inside a zipped file and determine the file type(s) inside
- Look inside a zipped file and determine the file type(s) inside:
`file -z {{foo.zip}}`
- Allow file to work with special or device files.
`file -s {{filename}}`
- Don't stop at first file type match; keep going until the end of the file.
`file -k {{filename}}`

View File

@ -1,27 +1,27 @@
# find
> Find files under the given directory tree, recursively
> Find files under the given directory tree, recursively.
- find files by extension
- Find files by extension:
`find {{root_path}} -name {{'*.py'}}`
- find files matching path pattern
- Find files matching path pattern:
`find {{root_path}} -path {{'**/lib/**/*.py'}}`
- run a command for each file, use {} within the command to access the filename
- Run a command for each file, use {} within the command to access the filename:
`find {{root_path}} -name {{'*.py'}} -exec {{wc -l {} }}\;`
- find files modified since a certain time
- Find files modified since a certain time:
`find {{root_path}} -name {{'*.py'}} -mtime {{-1d}}`
- find files using case insensitive name matching, of a certain size
- Find files using case insensitive name matching, of a certain size:
`find {{root_path}} -size +500k -size -10MB -iname {{'*.TaR.gZ'}}`
- delete files by name, older than a certain number of days
- Delete files by name, older than a certain number of days:
`find {{root_path}} -name {{'*.py'}} -mtime {{-180d}} -delete`

11
pages/common/for.md Normal file
View File

@ -0,0 +1,11 @@
# for
> Shell loop over parameters
- Perform a command with different arguments.
`for argument in 1 2 3; do {{command $argument}}; done`
- Perform a command in every directory.
`for d in *; do (cd $d; {{command}}); done`

27
pages/common/fortune.md Normal file
View File

@ -0,0 +1,27 @@
# fortune
> Print a random quotation (fortune-cookie style).
- Print a quotation:
`fortune`
- Print a quotation from a given database:
`fortune {{database}}`
- Print a list of quotation databases:
`fortune -f`
- Print an offensive quotation:
`fortune -o`
- Print a long quotation:
`fortune -l`
- Print a short quotation:
`fortune -s`

View File

@ -1,19 +1,19 @@
# fswebcam
> small and simple webcam for *nix
> Small and simple webcam for *nix.
- Take a picture
- Take a picture:
`fswebcam {{filename}}`
- Take a picture with custom resolution
- Take a picture with custom resolution:
`fswebcam -r {{width}}x{{height}} {{filename}}`
- Take a picture from selected device(Default is /dev/vidoe0)
- Take a picture from selected device(Default is /dev/vidoe0):
`fswebcam -d {{device}} {{filename}}`
- Take a picture with timestamp(timestamp string is formatted by strftime)
- Take a picture with timestamp(timestamp string is formatted by strftime):
`fswebcam --timestamp {{timestamp}} {{filename}}`

View File

@ -2,14 +2,14 @@
> Preprocesses and compiles C and C++ source files, then assembles and links them together.
- Compile multiple source files into executable
- Compile multiple source files into executable:
`gcc {{source1.c}} {{source2.c}} -o {{executable}}`
- Allow warnings, debug symbols in output
- Allow warnings, debug symbols in output:
`gcc {{source.c}} -Wall -Og -o {{executable}}`
- Include libraries from a different path
- Include libraries from a different path:
`gcc {{source.c}} -o {{executable}} -I{{header_path}} -L{{library_path}} -l{{library_name}}`

View File

@ -2,22 +2,22 @@
> Interact with the package manager for the Ruby programming language.
- Install latest version of a gem
- Install latest version of a gem:
`gem install {{gemname}}`
- Install specific version of a gem
- Install specific version of a gem:
`gem install {{gemname}} -v {{1.0.0}}`
- Update a gem
- Update a gem:
`gem update {{gemname}}`
- List all gems
- List all gems:
`gem list`
- Uninstall a gem
- Uninstall a gem:
`gem uninstall {{gemname}}`

View File

@ -1,15 +1,15 @@
# gifsicle
> Create gifs
> Create gifs.
- Making a GIF animation with gifsicle
- Making a GIF animation with gifsicle:
`gifsicle --delay={{10}} --loop *.gif > {{anim.gif}}`
- Extracting frames from an animation
- Extracting frames from an animation:
`gifsicle {{anim.gif}} '#0' > {{firstframe.gif}}`
- You can also edit animations by replacing, deleting, or inserting frames
- You can also edit animations by replacing, deleting, or inserting frames:
`gifsicle -b {{anim.gif}} --replace '#0' {{new.gif}}`

View File

@ -1,19 +1,19 @@
# git add
> Adds changed files to the index
> Adds changed files to the index.
- Add a file to the index
- Add a file to the index:
`git add {{PATHSPEC}}`
- Add all files (tracked and untracked)
- Add all files (tracked and untracked):
`git add .`
- Only add already tracked files
- Only add already tracked files:
`git add -u`
- Also add ignored files
- Also add ignored files:
`git add -f`

View File

@ -1,11 +1,11 @@
# git blame
> Show commit hash and last author on each line of a file
> Show commit hash and last author on each line of a file.
- Print file with author name and commit hash on each line
- Print file with author name and commit hash on each line:
`git blame {{file}}`
- Print file with author email and commit hash on each line
- Print file with author email and commit hash on each line:
`git blame -e {{file}}`

View File

@ -1,23 +1,23 @@
# git branch
> Main command for working with branches
> Main command for working with branches.
- List local branches. The current branch is highlighted by `*`.
- List local branches. The current branch is highlighted by `*`:
`git branch`
- List all local and remote branches
- List all local and remote branches:
`git branch -a`
- Create new branch based on current branch
- Create new branch based on current branch:
`git branch {{BRANCH-NAME}}`
- Delete a local branch
- Delete a local branch:
`git branch -d {{BRANCH-NAME}}`
- Move/Rename a branch
- Move/Rename a branch:
`git branch -m`

View File

@ -1,15 +1,15 @@
# git checkout
> Checkout a branch or paths to the working tree
> Checkout a branch or paths to the working tree.
- Switch to another branch
- Switch to another branch:
`git checkout {{BRANCH-NAME}}`
- Create and switch to a new branch
- Create and switch to a new branch:
`git checkout -b {{BRANCH-NAME}}`
- Undo unstaged local modification
- Undo unstaged local modification:
`git checkout .`
`git checkout .`

View File

@ -1,19 +1,19 @@
# git clone
> Clone an existing repository
> Clone an existing repository.
- Clone an existing repository
- Clone an existing repository:
`git clone {{REMOTE-REPOSITORY-LOCATION}}`
- For cloning from the local machine
- For cloning from the local machine:
`git clone -l`
- Do it quietly
- Do it quietly:
`git clone -q`
- Clone an existing repository, and truncate to the specified number of revisions, save your time mostly
- Clone an existing repository, and truncate to the specified number of revisions, save your time mostly:
`git clone --depth 10 {{REMOTE-REPOSITORY-LOCATION}}`

View File

@ -1,11 +1,11 @@
# git commit
>Commit staged files to the repository
> Commit staged files to the repository.
- Commit staged files to the repository with comment
- Commit staged files to the repository with comment:
`git commit -m {{MESSAGE}}`
- Replace the last commit with currently staged changes
- Replace the last commit with currently staged changes:
`git commit --amend`

View File

@ -1,27 +1,27 @@
# git config
> Get and set repository or global options
> Get and set repository or global options.
- Print list of options for current repository
- Print list of options for current repository:
`git config --list --local`
- Print global list of options, set in ~/.gitconfig
- Print global list of options, set in ~/.gitconfig:
`git config --list --global`
- Get full list of options
- Get full list of options:
`git config --list`
- Get value of alias.ls option
- Get value of alias.ls option:
`git config alias.st`
- Set option alias.ls=status in file ~/.gitconfig
- Set option alias.ls=status in file ~/.gitconfig:
`git config --global alias.ls "status"`
- Remove option alias.st from ~/.gitconfig
- Remove option alias.st from ~/.gitconfig:
`git config --global --unset alias.st`

View File

@ -1,19 +1,19 @@
# git diff
> Show changes to tracked files
> Show changes to tracked files.
- Show changes to tracked files
- Show changes to tracked files:
`git diff {{PATHSPEC}}`
- Show only names of changed files.
- Show only names of changed files:
`git diff --name-only {{PATHSPEC}}`
- Output a condensed summary of extended header information.
- Output a condensed summary of extended header information:
`git diff --summary {{PATHSPEC}}`
- Show staged (added, but not yet committed) changes only.
- Show staged (added, but not yet committed) changes only:
`git diff --staged`

View File

@ -1,11 +1,11 @@
# git init
> Initializes a new local Git repository
> Initializes a new local Git repository.
- Initialize a new local repository
- Initialize a new local repository:
`git init`
- Initialize a barebones repository
- Initialize a barebones repository:
`git init --bare`

View File

@ -1,15 +1,15 @@
# git log
>Show a history of commits
> Show a history of commits.
- Show a history of commits
- Show a history of commits:
`git log`
- Show the history of a particular file or directory, including differences
- Show the history of a particular file or directory, including differences:
`git log -p {{path}}`
- Show only the first line of each commits
- Show only the first line of each commits:
`git log --oneline`

View File

@ -1,11 +1,11 @@
# git merge
> Merge branches
> Merge branches.
- Merge a branch with your current branch
- Merge a branch with your current branch:
`git merge {{BRANCH-NAME}}`
- Edit the merge message
- Edit the merge message:
`git merge -e {{BRANCH-NAME}}`

View File

@ -2,14 +2,14 @@
> Move or rename files and update the git index.
- Move file inside the repo and add the movement to the next commit
- Move file inside the repo and add the movement to the next commit:
`git mv {{path/to/file}} {{new/path/to/file}}`
- Rename file and add renaming to the next commit
- Rename file and add renaming to the next commit:
`git mv {{filename}} {{new_filename}}`
- Overwrite the file in the target path if it exists
- Overwrite the file in the target path if it exists:
`git mv --force {{file}} {{target}}`

View File

@ -1,15 +1,15 @@
# git pull
> Fetch branch from a remote repository and merge it to local repository
> Fetch branch from a remote repository and merge it to local repository.
- Download changes from default remote repository and merge it
- Download changes from default remote repository and merge it:
`git pull`
- Download changes from default remote repository and use fast forward
- Download changes from default remote repository and use fast forward:
`git pull --rebase`
- Download changes from given remote repository and branch, then merge them into HEAD
- Download changes from given remote repository and branch, then merge them into HEAD:
`git pull {{remote_name}} {{branch}}`

View File

@ -1,23 +1,23 @@
# git push
> Push commits to a remote repository
> Push commits to a remote repository.
- Publish local changes on a remote branch
- Publish local changes on a remote branch:
`git push {{REMOTE-NAME}} {{LOCAL-BRANCH}}`
- Publish local changes on a remote branch of different name
- Publish local changes on a remote branch of different name:
`git push {{REMOTE-NAME}} {{LOCAL-BRANCH}}:{{REMOTE-BRANCH}}`
- Remove remote branch
- Remove remote branch:
`git push {{REMOTE-NAME}} :{{REMOTE-BRANCH}}`
- Remove remote branches which don't exist locally
- Remove remote branches which don't exist locally:
`git push --prune {{REMOTE-NAME}}`
- Publish tags
- Publish tags:
`git push --tags`

View File

@ -1,23 +1,23 @@
# git remote
> Manage set of tracked repositories (“remotes”)
> Manage set of tracked repositories (“remotes”).
- Show a list of existing remotes, their names and URL
- Show a list of existing remotes, their names and URL:
`git remote -v`
- Add a remote
- Add a remote:
`git remote add {{remote_name}} {{remote_url}}`
- Change the URL of a remote
- Change the URL of a remote:
`git remote set-url {{remote_name}} {{new_url}}`
- Remove a remote
- Remove a remote:
`git remote remove {{remote_name}}`
- Rename a remote
- Rename a remote:
`git remote rename {{old_name}} {{new_name}}`

View File

@ -1,15 +1,15 @@
# git rm
> Remove files from repository index and local filesystem
> Remove files from repository index and local filesystem.
- Remove file from repository index and filesystem
- Remove file from repository index and filesystem:
`git rm {{file}}`
- Remove directory
- Remove directory:
`git rm -r {{directory}}`
- Remove file from repository index but keep it untouched locally
- Remove file from repository index but keep it untouched locally:
`git rm --cached {{file}}`

View File

@ -1,27 +1,27 @@
# git stash
> Stash local Git changes in a temporary area
> Stash local Git changes in a temporary area.
- stash current changes (except new files)
- Stash current changes (except new files):
`git stash save {{optional_stash_name}}`
- include new files in the stash (leaves the index completely clean)
- Include new files in the stash (leaves the index completely clean):
`git stash save -u {{optional_stash_name}}`
- list all stashes
- List all stashes:
`git stash list`
- re-apply the latest stash
- Re-apply the latest stash:
`git stash pop`
- re-apply a stash by name
- Re-apply a stash by name:
`git stash apply {{stash_name}}`
- drop a stash by an index
- Drop a stash by an index:
`git stash drop stash@{index}`

View File

@ -1,11 +1,11 @@
# git status
> Show the index (changed files)
> Show the index (changed files).
- Show changed files which are not yet added for commit
- Show changed files which are not yet added for commit:
`git status`
- Give output in short format
- Give output in short format:
`git status -s`

15
pages/common/git-svn.md Normal file
View File

@ -0,0 +1,15 @@
# git svn
> Bidirectional operation between a Subversion repository and Git.
- Clone an SVN repository:
`git svn clone {{http://example.com/my_subversion_repo}} {{local_dir}}`
- Update local clone from the upstream SVN repository:
`git svn rebase`
- Commit back to SVN repository:
`git svn dcommit`

View File

@ -3,18 +3,18 @@
> Create, list, delete or verify tags.
> Tag is reference to specific commit.
- List all tags
- List all tags:
`git tag`
- Create a tag with the given name pointing to the current commit
- Create a tag with the given name pointing to the current commit:
`git tag {{tag_name}}`
- Create a tag with the given message
- Create a tag with the given message:
`git tag {{tag_name}} -m {{tag_message}}`
- Delete the tag with the given name
- Delete the tag with the given name:
`git tag -d {{tag_name}}`

View File

@ -1,19 +1,19 @@
# git
> Main command for all git commands
> Main command for all git commands.
- Check the Git version
- Check the Git version:
`git --version`
- Call general help
- Call general help:
`git --help`
- Call help on a command
- Call help on a command:
`git help {{COMMAND}}`
- Execute Git command
- Execute Git command:
`git {{COMMAND}}`

View File

@ -1,23 +1,23 @@
# gpg
> Gnu Privacy Guard
> Gnu Privacy Guard.
- sign doc.txt without encryption (writes output to doc.txt.asc)
- Sign doc.txt without encryption (writes output to doc.txt.asc):
`gpg --clearsign {{doc.txt}}`
- encrypt doc.txt for alice@example.com (output to doc.txt.gpg)
- Encrypt doc.txt for alice@example.com (output to doc.txt.gpg):
`gpg --encrypt --recipient {{alice@example.com}} {{doc.txt}}`
- encrypt doc.txt with only a passphrase (output to doc.txt.gpg)
- Encrypt doc.txt with only a passphrase (output to doc.txt.gpg):
`gpg --symmetric {{doc.txt}}`
- decrypt doc.txt.gpg (output to STDOUT)
- Decrypt doc.txt.gpg (output to STDOUT):
`gpg --decrypt {{doc.txt.gpg}}`
- Import a public key
- Import a public key:
`gpg --import {{public.gpg}}`

View File

@ -1,15 +1,15 @@
# Gradle
> Gradle is the official build system for Android Studio
> Gradle is the official build system for Android Studio.
- Compile a package
- Compile a package:
`gradle build`
- Clear the build folder
- Clear the build folder:
`gradle clean`
- Compile and Release package
- Compile and Release package:
`gradle assembleRelease`

View File

@ -1,32 +1,36 @@
# grep
> Matches patterns in input text
> Supports simple patterns and regular expressions
> Matches patterns in input text.
> Supports simple patterns and regular expressions.
- search for an exact string
- Search for an exact string:
`grep {{something}} {{file_path}}`
- search recursively in current directory for an exact string
- Search recursively in current directory for an exact string:
`grep -r {{something}} .`
- use a regex
- Use a regex:
`grep -e {{^regex$}} {{file_path}}`
- see 3 lines of context
- See 3 lines of context:
`grep -C 3 {{something}} {{file_path}}`
- print the count of matches instead of the matching text
- Print the count of matches instead of the matching text:
`grep -c {{something}} {{file_path}}`
- use the standard input instead of a file
- Print line number for each match:
`grep -n {{something}} {{file_path}}`
- Use the standard input instead of a file:
`cat {{file_path}} | grep {{something}}`
- invert match for excluding specific strings
- Invert match for excluding specific strings:
`grep -v {{something}}`

View File

@ -1,23 +1,23 @@
# gzip
> Compress/uncompress files with gzip compression (LZ77)
> Compress/uncompress files with gzip compression (LZ77).
- compress a file, replacing it with a gzipped compressed version
- Compress a file, replacing it with a gzipped compressed version:
`gzip {{file.ext}}`
- decompress a file, replacing it with the original uncompressed version
- Decompress a file, replacing it with the original uncompressed version:
`gzip -d {{file.ext.gz}}`
- compress a file specifying the output filename
- Compress a file specifying the output filename:
`gzip -c {{file.ext}} > compressed-file.ext.gz`
- uncompress a gzipped file specifying the output filename
- Uncompress a gzipped file specifying the output filename:
`gzip -c -d {{file.ext.gz}} > uncompressed-file.ext`
- specify the compression level. 1=Fastest (Worst), 9=Slowest (Best), Default level is 6
- Specify the compression level. 1=Fastest (Worst), 9=Slowest (Best), Default level is 6:
`gzip -9 -c {{file.ext}} > compressed-file.ext.gz`

View File

@ -1,19 +1,19 @@
# HandBrakeCLI
> Video conversion tool
> Video conversion tool.
- Convert a video file to MKV (AAC 160kbit audio and x264 CRF20 video)
- Convert a video file to MKV (AAC 160kbit audio and x264 CRF20 video):
`HandBrakeCLI -i {{input.avi}} -o {{output.mkv}} -e x264 -q 20 -B 160`
- Resize a video file to 320x240
- Resize a video file to 320x240:
`HandBrakeCLI -i {{input.mp4}} -o {{output.mp4} -w 320 -l 240`
- List available presets
- List available presets:
`HandBrakeCLI --preset-list`
- Convert an AVI video to MP4 using the Android preset
- Convert an AVI video to MP4 using the Android preset:
`HandBrakeCLI --preset="Android" -i {{input.ext}} -o {{output.mp4}}`

View File

@ -1,19 +1,19 @@
# haxelib
> Haxe Library Manager
> Haxe Library Manager.
- Search for a Haxe library
- Search for a Haxe library:
`haxelib search {{keyword}}`
- Install a Haxe library
- Install a Haxe library:
`haxelib install {{libname}}`
- Upgrade all installed Haxe libraries
- Upgrade all installed Haxe libraries:
`haxelib upgrade`
- Install the development version of a library from a Git repository
- Install the development version of a library from a Git repository:
`haxelib git {{libname}} {{GIT-URL}}`

View File

@ -2,10 +2,10 @@
> Command Line history.
- Display the commands history list with line numbers
- Display the commands history list with line numbers:
`history`
- Clear the commands history list (only for `bash`)
- Clear the commands history list (only for `bash`):
`history -c`

View File

@ -1,15 +1,15 @@
# host
> Lookup Domain Name Server
> Lookup Domain Name Server.
- Lookup A, AAAA, and MX records of a domain
- Lookup A, AAAA, and MX records of a domain:
`host {{domain}}`
- Lookup a field (CNAME, TXT,...) of a domain
- Lookup a field (CNAME, TXT,...) of a domain:
`host -t {{field}} {{domain}}`
- Reverse lookup an IP
- Reverse lookup an IP:
`host {{ip_address}}`

View File

@ -1,15 +1,15 @@
# iconv
> Converts text from one encoding to another
> Converts text from one encoding to another.
- convert file and print to stdout
- Convert file and print to stdout:
`iconv -f {{from_encoding}} -t {{to_encoding}} {{input_file}}`
- convert file to current locale
- Convert file to current locale:
`iconv -f {{from_encoding}} {{input_file}} > {{output_file}}`
- list supported encodings
- List supported encodings:
`iconv -l`

11
pages/common/if.md Normal file
View File

@ -0,0 +1,11 @@
# if
> Simple shell conditional
- Echo a different thing depending on a command's success.
`{{command}} && echo "success" || echo "failure"`
- Full if syntax.
`if {{condition}}; then echo "true"; else echo "false"; fi`

View File

@ -1,23 +1,23 @@
# ifconfig
> ifconfig - Interface Configurator, used to configure network interfaces.
> Ifconfig - Interface Configurator, used to configure network interfaces.
- View network settings of an ethernet adapter.
- View network settings of an ethernet adapter:
`ifconfig eth0`
- Display details of all interfaces, including disabled interfaces.
- Display details of all interfaces, including disabled interfaces:
`ifconfig -a`
- Disable eth0 interface.
- Disable eth0 interface:
`ifconfig eth0 down`
- Enable eth0 interface.
- Enable eth0 interface:
`ifconfig eth0 up`
- Assign IP address to eth0 interface.
- Assign IP address to eth0 interface:
`ifconfig eth0 {{ip_address}}`

17
pages/common/ionice.md Normal file
View File

@ -0,0 +1,17 @@
# ionice
> Get or set program I/O scheduling class and priority.
> Scheduling classes: 1 (realtime), 2 (best-effort), 3 (idle).
> Priority levels: 0 (the highest) - 7 (the lowest).
- Set I/O scheduling class of a running process:
`ionice -c {{scheduling_class}} -p {{pid}}`
- Run a command with custom I/O scheduling class and priority:
`ionice -c {{scheduling_class}} -n {{priority}} {{command}}`
- Print the I/O scheduling class and priority of a running process:
`ionice -p {{pid}}`

View File

@ -1,19 +1,19 @@
# ioping
> monitor I/O latency in real time
> Monitor I/O latency in real time.
- Show disk I/O latency using the default values and the current directory
- Show disk I/O latency using the default values and the current directory:
`ioping .`
- Measure latency on /tmp using 10 requests of 1 megabyte each.
- Measure latency on /tmp using 10 requests of 1 megabyte each:
`ioping -c 10 -s 1M /tmp`
- Measure disk seek rate on /dev/sda.
- Measure disk seek rate on /dev/sda:
`ioping -R /dev/sda`
- Measure disk sequential speed on /dev/sda.
- Measure disk sequential speed on /dev/sda:
`ioping -RL /dev/sda`

View File

@ -1,11 +1,11 @@
# ipcs
> Display information about ressources used in IPC (Inter-process Communication)
> Display information about ressources used in IPC (Inter-process Communication).
- Specific information about the Message Queue which has the id 32768
- Specific information about the Message Queue which has the id 32768:
`ipcs -qi 32768`
- General information about all the IPC
- General information about all the IPC:
`ipcs -a`

View File

@ -2,15 +2,14 @@
> Java Application Launcher.
- Execute a java .class file that contains a main method by using just the class name.
- Execute a java .class file that contains a main method by using just the class name:
`java {{filename}}`
- Execute a .jar program.
- Execute a .jar program:
`java -jar {{filename.jar}}`
- Display JDK, JRE and HotSpot versions.
- Display JDK, JRE and HotSpot versions:
`java -version`

View File

@ -2,6 +2,6 @@
> Java Application Compiler.
- Compile a .java file.
- Compile a .java file:
`javac {{filename.java}}`

View File

@ -1,12 +1,12 @@
# kill
> Sends a signal to a process
> Mostly used for stopping processes
> Sends a signal to a process.
> Mostly used for stopping processes.
- kill the process
- Kill the process:
`kill {{process_id}}`
- list signal names
- List signal names:
`kill -l`

View File

@ -1,27 +1,27 @@
# last
> View the last logged in users
> View the last logged in users.
- view last logins, their duration and other information as read from /var/log/wtmp
- View last logins, their duration and other information as read from /var/log/wtmp:
`last`
- specify how many of the last logins to show
- Specify how many of the last logins to show:
`last -n {{login_count}}`
- view full login times and dates
- View full login times and dates:
`last -F`
- view the last login by a specific user
- View the last login by a specific user:
`last {{user_name}}`
- view the last reboot (last login of the pseudo user reboot)
- View the last reboot (last login of the pseudo user reboot):
`last reboot`
- view the last shutdown (last login of the pseudo user shutdown)
- View the last shutdown (last login of the pseudo user shutdown):
`last shutdown`

View File

@ -1,25 +1,25 @@
# less
> Opens a file for reading
> Allows movement and search
> Doesn't read the entire file (suitable for logs)
> Opens a file for reading.
> Allows movement and search.
> Doesn't read the entire file (suitable for logs).
- open a file
- Open a file:
`less {{source_file}}`
- page up / down
- Page up / down:
`d (next), D (previous)`
- go to start / end of file
- Go to start / end of file:
`g (start), G (end)`
- search for a string
- Search for a string:
`/{{something}} then n (next), N (previous)`
- exit
- Exit:
`q`

Some files were not shown because too many files have changed in this diff Show More