Merge remote-tracking branch 'upstream/master'

Conflicts:
	pages/common/touch.md
waldyrious/alt-syntax
Ruben Vereecken 2016-01-07 16:52:22 +01:00
commit 9a991e4cb0
52 changed files with 642 additions and 48 deletions

View File

@ -82,7 +82,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 +102,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

@ -41,21 +41,28 @@ for the most common UNIX / Linux / OSX / SunOS commands.
You can access these pages on your computer using one of the following clients:
- [Node.js client](https://github.com/tldr-pages/tldr-node-client) : `npm install -g tldr`
- [Python client](https://github.com/tldr-pages/tldr-python-client) : `pip install tldr`
- [Python client](https://github.com/lord63/tldr.py): `pip install tldr.py`
- Python clients:
- [tldr-python-client](https://github.com/tldr-pages/tldr-python-client) : `pip install tldr`
- [tldr.py](https://github.com/lord63/tldr.py): `pip install tldr.py`
- [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 available soon
- [C++ client](https://github.com/tldr-pages/tldr-cpp-client): `brew tap tldr-pages/tldr && brew install tldr`
- Android client:
(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 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 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')`
- [Web client](https://github.com/ostera/tldr.jsx): try tldr on your browser
[here](https://ostera.github.io/tldr.jsx)!
- [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)
Let us know if you are building one and we can add it to this list!
@ -67,3 +74,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}}`

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}}`

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}}`

23
pages/common/bashmarks.md Normal file
View File

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

15
pages/common/cowsay.md Normal file
View File

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

View File

@ -5,7 +5,7 @@
- Download a URL to a file
`curl "{{URL}}" -o filename`
`curl "{{URL}}" -o {{filename}}`
- send form-encoded data

View File

@ -18,3 +18,11 @@
- 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}}`

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}}`

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`

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

@ -23,6 +23,10 @@
`grep -c {{something}} {{file_path}}`
- print line number for each match
`grep -n {{something}} {{file_path}}`
- use the standard input instead of a file
`cat {{file_path}} | grep {{something}}`

View File

@ -1,6 +1,6 @@
# host
Lookup Domain Name Server
> Lookup Domain Name Server
- Lookup A, AAAA, and MX records of a domain

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}}`

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

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

View File

@ -10,10 +10,6 @@
`ln -sf {{path/to/new/original/file}} {{path/to/file/link}}`
- overwrite a symbolic link to a folder
`ln -sfT {{path/to/new/original/file}} {{path/to/folder/link}}`
- create a hard link to a file or folder
- create a hard link to a file
`ln {{path/to/original/file}} {{path/to/link}}`

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

@ -0,0 +1,27 @@
# mailx
> Send and receive mail.
- To send mail, the content is typed after the command and ended with Control-D
`mailx -s "{{subject}}" {{to_addr}}`
- Send mail with short content.
`echo "{{content}}" | mailx -s "{{subject}}" {{to_addr}}`
- Send mail with content which written in a file.
`mailx -s "{{subject}}" {{to_addr}} < {{content.txt}}`
- Send mail to a recipient and CC to another address.
`mailx -s "{{subject}}" -c {{cc_addr}} {{to_addr}}`
- Send mail and set sender address.
`mailx -s "{{subject}}" -r {{from_addr}} {{to_addr}}`
- Send mail with an attachment.
`mailx -a {{file}} -s "{{subject}}" {{to_addr}}`

21
pages/common/make.md Normal file
View File

@ -0,0 +1,21 @@
# make
> Task runner for rules described in Makefile.
> Mostly used to control the compilation of an executable from source code.
- Call the all rule
`make`
- Call a specific rule
`make {{rule}}`
- Use specific Makefile
`make -f {{file}}`
- Execute make from another directory
`make -C {{directory}}`

23
pages/common/mocha.md Normal file
View File

@ -0,0 +1,23 @@
# mocha
> Execute Mocha JavaScript test runner
- Run tests with default configuration or as configured in `mocha.opts`
`mocha`
- Run tests contained at a specific location
`mocha {{folder/with/tests}}`
- Run tests that match a specific grep pattern
`mocha --grep {{^regex$}}`
- Run tests on changes to JavaScript files in the current directory and once initially
`mocha --watch`
- Run tests with a specific reporter
`mocha --reporter {{reporter}}`

View File

@ -13,3 +13,7 @@
- Start server with a prefix for all relative paths in config file
`nginx -c {{config_file}} -p {{prefix/for/relative/paths}}`
- Test configuration without affecting the running server
`nginx -t`

28
pages/common/pass.md Normal file
View File

@ -0,0 +1,28 @@
# pass
> safely store and read passwords or other sensitive data easily
> all data is GPG-encrypted, and managed with a git repository
- initialize the storage using a gpg-id for encryption
`pass init {{gpg_id}}`
- save a new password (prompts you for the value without echoing it)
`pass insert {{path/to/data}}`
- copy a password (first line of the data file) to the clipboard
`pass -c {{path/to/data}}`
- list the whole store tree
`pass`
- generate a new random password with a given length, and copy it to the clipboard
`pass generate -c {{path/to/data}} {{num}}`
- run any git command against the underlying store repository
`pass git {{git-arguments}}`

View File

@ -4,16 +4,12 @@
- return PIDs of any running processes with a matching command string
`pgrep {{Finder}}`
`pgrep {{process_name}}`
- search full command line with parameters instead of just the process name
`pgrep -f "{{ssh root}}"`
`pgrep -f "{{process_name}} {{parameter}}"`
- search for process run by a specific user
`pgrep -u root {{firefox}}`
- kill all processes which match
`pkill -9 {{Finder}}`
`pgrep -u root {{process_name}}`

12
pages/common/pkill.md Normal file
View File

@ -0,0 +1,12 @@
# pkill
> Signal process by name
> Mostly used for stopping processes
- kill all processes which match
`pkill -9 {{process_name}}`
- send SIGUSR1 signal to processes which match
`pkill -USR1 {{process_name}}`

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

@ -0,0 +1,19 @@
# Sass
> Converts SCSS or Sass files to CSS
- Output converted file to stdout
`sass {{inputfile.(scss|sass)}}`
- Immediately convert SCSS or Sass file to CSS to specified output file
`sass {{inputfile.(scss|sass)}} {{outputfile.css}}`
- Watch SCSS or Sass file for changes and output or update CSS file with same filename
`sass --watch {{inputfile.(scss|sass)}}`
- Watch SCSS or Sass file for changes and output or update CSS file with specified filename
`sass --watch {{inputfile.(scss|sass)}}:{{outputfile.css}}`

15
pages/common/sl.md Normal file
View File

@ -0,0 +1,15 @@
# sl
> Steam locomotive running through your terminal.
- Let a steam locomotive run through your terminal.
`sl`
- The train burns, people scream.
`sl -a`
- Let the train fly.
`sl -F`

View File

@ -17,7 +17,7 @@
- run a command on a remote server
`ssh {{remote_host}} "{{command -with -flags}}"`
`ssh {{remote_host}} {{command -with -flags}}`
- ssh tunneling: dynamic port forwarding (SOCKS proxy on localhost:9999)

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

@ -0,0 +1,11 @@
# su
> switch shell to another user
- Switch to user {{username}} (password required):
`su {{username}}`
- Switch to superuser (admin password required):
`su`

View File

@ -14,9 +14,9 @@
`tcpdump host {{www.example.com}}`
- capture the traffic from a specific interface, source, destination and port
- capture the traffic from a specific interface, source, destination and destination port
`tcpdump -i {{eth0}} src {{192.168.1.1}} dest {{192.168.1.2}} and port 80`
`tcpdump -i {{eth0}} src {{192.168.1.1}} and dst {{192.168.1.2}} and dst port 80`
- capture the traffic of a network

View File

@ -2,7 +2,7 @@
> Change a file access and modification times (atime, mtime)
- Create a new empty file(s) or change the times for existing file(s) to current time.
- Create a new empty file(s) or change the times for existing file(s) to current time
`touch {{filename}}`

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

@ -0,0 +1,19 @@
# unrar
> Extract RAR archives
- extract files with original directory structure
`unrar x {{compressed.rar}}`
- extract files into current directory, losing directory structure in the archive
`unrar e {{compressed.rar}}`
- test integrity of each file inside the archive file
`unrar t {{compressed.rar}}`
- list files inside the archive file without decompressing it
`unrar l {{compressed.rar}}`

23
pages/common/vagrant.md Normal file
View File

@ -0,0 +1,23 @@
# vagrant
> Manage lightweight, reproducible, and portable development environments
- Create Vagrantfile in current folder with the base Vagrant box
`vagrant init`
- Create Vagrantfile with the Ubuntu 14.04 (Trusty Tahr) box from HashiCorp Atlas
`vagrant init ubuntu/trusty32`
- Start and provision the vagrant environment
`vagrant up`
- Suspend the machine
`vagrant suspend`
- Connect to machine via SSH
`vagrant ssh`

View File

@ -1,6 +1,6 @@
# vim
> Vi IMproved, a programmers text editor
> Vi IMproved, a programmer's text editor
- open a file with cursor at the given line number

19
pages/linux/dpkg-query.md Normal file
View File

@ -0,0 +1,19 @@
# dpkg-query
> A tool that shows information about installed packages.
- List all installed packages.
`dpkg-query -l`
- List installed packages matching a pattern.
`dpkg-query -l '{{pattern}}'`
- List all files installed by a package.
`dpkg-query -L {{package_name}}`
- Show information about a package.
`dpkg-query -s {{package_name}}`

View File

@ -4,16 +4,16 @@
- Output the first few lines of a file
`head -n {{count of lines}} {{filename}}`
`head -n {{count_of_lines}} {{filename}}`
- Output the first few bytes of a file
`head -c {{size in kilobytes}} {{filename}}`
`head -c {{size_in_bytes}} {{filename}}`
- Output everything but the last few lines of a file
`head -n -{{count of lines}} {{filename}}`
`head -n -{{count_of_lines}} {{filename}}`
- Output everything but the last few bytes of a file
`head -c -{{size in kilobytes}} {{filename}}`
`head -c -{{size_in_bytes}} {{filename}}`

View File

@ -1,6 +1,6 @@
# hostname
Show or set the system's host name
> Show or set the system's host name
- Show current host name

27
pages/linux/jobs.md Normal file
View File

@ -0,0 +1,27 @@
# jobs
> BASH builtin for viewing information about processes spawned by the current shell.
- view jobs spawned by the current shell
`jobs`
- list jobs and their process ids
`jobs -l`
- display information about jobs with changed status
`jobs -n`
- display process id of process group leader
`jobs -p`
- display running processes
`jobs -r`
- display stopped processes
`jobs -s`

19
pages/linux/nethogs.md Normal file
View File

@ -0,0 +1,19 @@
# nethogs
> Monitor bandwidth usage per process
- Start nethogs as root (default device is eth0)
`sudo nethogs`
- Monitor bandwidth on specific device
`sudo nethogs {{device}}`
- Monitor bandwidth on multiple devices
`sudo nethogs {{device1}} {{device2}}`
- Specify refresh rate
`sudo nethogs -t {{seconds}}`

View File

@ -4,7 +4,7 @@
- synchronize and update all packages
`pacman -Syyu`
`pacman -Syu`
- install a new package
@ -25,3 +25,11 @@
- list only the explicitly installed packages and versions
`pacman -Qe`
- find which package owns a certain file
`pacman -Qo filename`
- empty package cache to free up space
`pacman -Scc`

View File

@ -0,0 +1,11 @@
# ssh-copy-id
> Install your public key in a remote machine's authorized_keys.
- Copy the given public key to the remote
`ssh-copy-id -i {{path/to/certificate}} {{username}}@{{remote_host}}`
- Copy the given public key to the remote with specific port
`ssh-copy-id -i {{path/to/certificate}} -p {{port}} {{username}}@{{remote_host}}`

View File

@ -13,3 +13,7 @@
- Count time, calls, and errors for each system call and report a summary on program exit.
`strace -p {{pid}} -c`
- Show the time spent in every system call
`strace -p {{pid}} -T`

View File

@ -0,0 +1,19 @@
# timedatectl
> Control the system time and date
- To check the current system clock time
`timedatectl`
- To set the local time of the system clock directly
`timedatectl set-time {{"yyyy-MM-dd hh:mm:ss"}}`
- To list available timezones
`timedatectl list-timezones`
- To change timezones
`timedatectl set-timezone {{timezone}}`

19
pages/linux/ulimit.md Normal file
View File

@ -0,0 +1,19 @@
# ulimit
> Get and set user limits
- get the properties of all the user limits
`ulimit -a`
- get hard limit for the number of simultaneously opened files
`ulimit -H -n`
- get soft limit for the number of simultaneously opened files
`ulimit -S -n`
- set max per-user process limit
`ulimit -u 30`

23
pages/linux/zypper.md Normal file
View File

@ -0,0 +1,23 @@
# zypper
> SUSE & openSUSE package management utility
- Synchronize list of packages and versions available
`zypper refresh`
- Install a new package
`zypper install {{package}}`
- Remove a package
`zypper remove {{package}}`
- Upgrade installed packages to newest available versions
`zypper update`
- Search package via keyword
`zypper search {{keyword}}`

15
pages/osx/ditto.md Normal file
View File

@ -0,0 +1,15 @@
# ditto
> Copy files and folders
- Overwrites contents of destination folder with contents of source folder
`ditto {{path/to/source}} {{path/to/destination}}`
- print a line to the Terminal window for every file thats being copied
`ditto -V {{path/to/source}} {{path/to/destination}}`
- copy a given file or folder, while retaining the original file permissions.
`ditto -rsrc {{path/to/source}} {{path/to/destination}}`

View File

@ -4,8 +4,8 @@
- Output the first few lines of a file
`head -n {{count of lines}} {{filename}}`
`head -n {{count_of_lines}} {{filename}}`
- Output the first few bytes of a file
`head -c {{number in kilobytes}} {{filename}}`
`head -c {{number_in_bytes}} {{filename}}`

View File

@ -1,6 +1,6 @@
# hostname
Show or set the system's host name
> Show or set the system's host name
- Show current host name

View File

@ -2,11 +2,11 @@
> List files matching a given query
- Find a file by it's name
- Find a file by its name
`mdfind -name {{file}}`
- Find a file by it's content
- Find a file by its content
`mdfind {{query}}`