diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0f7a1de0e..f4941afa6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -82,7 +82,7 @@ Detailed explanation: git checkout -b ``` -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: `: 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 diff --git a/MAINTAINERS b/MAINTAINERS deleted file mode 100644 index b291a7397..000000000 --- a/MAINTAINERS +++ /dev/null @@ -1,6 +0,0 @@ -Romain Prieto (@rprieto) -Igor Shubovych (@igorshubovych) -Ruben Vereecken (@rubenvereecken) -Waldir Pimenta (@waldyrious) -Felix Yan (@felixonmars) -Leandro Ostera (@ostera) diff --git a/README.md b/README.md index 6f5a66e0d..0fe8abc7b 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/pages/common/7za.md b/pages/common/7za.md new file mode 100644 index 000000000..0f75e9a32 --- /dev/null +++ b/pages/common/7za.md @@ -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}}` diff --git a/pages/common/adb.md b/pages/common/adb.md new file mode 100644 index 000000000..59c4ec967 --- /dev/null +++ b/pages/common/adb.md @@ -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}}` diff --git a/pages/common/bash.md b/pages/common/bash.md new file mode 100644 index 000000000..4174bd4bf --- /dev/null +++ b/pages/common/bash.md @@ -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}}` diff --git a/pages/common/bashmarks.md b/pages/common/bashmarks.md new file mode 100644 index 000000000..7ba7035d8 --- /dev/null +++ b/pages/common/bashmarks.md @@ -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}}` diff --git a/pages/common/cowsay.md b/pages/common/cowsay.md new file mode 100644 index 000000000..4def52df4 --- /dev/null +++ b/pages/common/cowsay.md @@ -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 ..."` diff --git a/pages/common/curl.md b/pages/common/curl.md index d0ee68265..b7cbd8504 100644 --- a/pages/common/curl.md +++ b/pages/common/curl.md @@ -5,7 +5,7 @@ - Download a URL to a file -`curl "{{URL}}" -o filename` +`curl "{{URL}}" -o {{filename}}` - send form-encoded data diff --git a/pages/common/docker.md b/pages/common/docker.md index 961946ee9..56d47f152 100644 --- a/pages/common/docker.md +++ b/pages/common/docker.md @@ -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}}` diff --git a/pages/common/enca.md b/pages/common/enca.md new file mode 100644 index 000000000..b19308a74 --- /dev/null +++ b/pages/common/enca.md @@ -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}}` diff --git a/pages/common/fortune.md b/pages/common/fortune.md new file mode 100644 index 000000000..e3327f05f --- /dev/null +++ b/pages/common/fortune.md @@ -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` diff --git a/pages/common/git-svn.md b/pages/common/git-svn.md new file mode 100644 index 000000000..4ceb825d5 --- /dev/null +++ b/pages/common/git-svn.md @@ -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` diff --git a/pages/common/grep.md b/pages/common/grep.md index 8b1a2ed37..e25f44842 100644 --- a/pages/common/grep.md +++ b/pages/common/grep.md @@ -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}}` diff --git a/pages/common/host.md b/pages/common/host.md index 6a5927eda..784f24245 100644 --- a/pages/common/host.md +++ b/pages/common/host.md @@ -1,6 +1,6 @@ # host -Lookup Domain Name Server +> Lookup Domain Name Server - Lookup A, AAAA, and MX records of a domain diff --git a/pages/common/ionice.md b/pages/common/ionice.md new file mode 100644 index 000000000..0886354e4 --- /dev/null +++ b/pages/common/ionice.md @@ -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}}` diff --git a/pages/common/last.md b/pages/common/last.md new file mode 100644 index 000000000..90b44a63e --- /dev/null +++ b/pages/common/last.md @@ -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` diff --git a/pages/common/ln.md b/pages/common/ln.md index c8a8590c2..f9f591c15 100644 --- a/pages/common/ln.md +++ b/pages/common/ln.md @@ -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}}` diff --git a/pages/common/mailx.md b/pages/common/mailx.md new file mode 100644 index 000000000..0e20c0012 --- /dev/null +++ b/pages/common/mailx.md @@ -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}}` diff --git a/pages/common/make.md b/pages/common/make.md new file mode 100644 index 000000000..05694fa93 --- /dev/null +++ b/pages/common/make.md @@ -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}}` + diff --git a/pages/common/mocha.md b/pages/common/mocha.md new file mode 100644 index 000000000..53fdc2109 --- /dev/null +++ b/pages/common/mocha.md @@ -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}}` diff --git a/pages/common/nginx.md b/pages/common/nginx.md index 4bbe43127..65cd778a3 100644 --- a/pages/common/nginx.md +++ b/pages/common/nginx.md @@ -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` diff --git a/pages/common/pass.md b/pages/common/pass.md new file mode 100644 index 000000000..f12fde24f --- /dev/null +++ b/pages/common/pass.md @@ -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}}` diff --git a/pages/common/pgrep.md b/pages/common/pgrep.md index 8768690f2..750a5f69d 100644 --- a/pages/common/pgrep.md +++ b/pages/common/pgrep.md @@ -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}}` diff --git a/pages/common/pkill.md b/pages/common/pkill.md new file mode 100644 index 000000000..d6121443b --- /dev/null +++ b/pages/common/pkill.md @@ -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}}` diff --git a/pages/common/sass.md b/pages/common/sass.md new file mode 100644 index 000000000..9a990e8fb --- /dev/null +++ b/pages/common/sass.md @@ -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}}` diff --git a/pages/common/sl.md b/pages/common/sl.md new file mode 100644 index 000000000..ae2f5a5ec --- /dev/null +++ b/pages/common/sl.md @@ -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` diff --git a/pages/common/ssh.md b/pages/common/ssh.md index c34da4e26..446e51a08 100644 --- a/pages/common/ssh.md +++ b/pages/common/ssh.md @@ -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) diff --git a/pages/common/su.md b/pages/common/su.md new file mode 100644 index 000000000..885ab59c8 --- /dev/null +++ b/pages/common/su.md @@ -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` diff --git a/pages/common/tcpdump.md b/pages/common/tcpdump.md index 8a62767a1..f3e427d11 100644 --- a/pages/common/tcpdump.md +++ b/pages/common/tcpdump.md @@ -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 diff --git a/pages/common/touch.md b/pages/common/touch.md index 5838b67a9..7937c861f 100644 --- a/pages/common/touch.md +++ b/pages/common/touch.md @@ -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}}` diff --git a/pages/common/unrar.md b/pages/common/unrar.md new file mode 100644 index 000000000..1f7e2d0b0 --- /dev/null +++ b/pages/common/unrar.md @@ -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}}` diff --git a/pages/common/vagrant.md b/pages/common/vagrant.md new file mode 100644 index 000000000..b7efaba8b --- /dev/null +++ b/pages/common/vagrant.md @@ -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` diff --git a/pages/common/vim.md b/pages/common/vim.md index c2dd198de..14ed709da 100644 --- a/pages/common/vim.md +++ b/pages/common/vim.md @@ -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 diff --git a/pages/linux/dpkg-query.md b/pages/linux/dpkg-query.md new file mode 100644 index 000000000..a7e9c778e --- /dev/null +++ b/pages/linux/dpkg-query.md @@ -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}}` diff --git a/pages/linux/head.md b/pages/linux/head.md index 192145d47..948b8f84b 100644 --- a/pages/linux/head.md +++ b/pages/linux/head.md @@ -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}}` diff --git a/pages/linux/hostname.md b/pages/linux/hostname.md index b807d87b6..592179bc2 100644 --- a/pages/linux/hostname.md +++ b/pages/linux/hostname.md @@ -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 diff --git a/pages/linux/jobs.md b/pages/linux/jobs.md new file mode 100644 index 000000000..351ac6330 --- /dev/null +++ b/pages/linux/jobs.md @@ -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` diff --git a/pages/linux/nethogs.md b/pages/linux/nethogs.md new file mode 100644 index 000000000..f40209583 --- /dev/null +++ b/pages/linux/nethogs.md @@ -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}}` diff --git a/pages/linux/pacman.md b/pages/linux/pacman.md index 8d32c0e57..297aa8789 100644 --- a/pages/linux/pacman.md +++ b/pages/linux/pacman.md @@ -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` diff --git a/pages/linux/ssh-copy-id.md b/pages/linux/ssh-copy-id.md new file mode 100644 index 000000000..727764b53 --- /dev/null +++ b/pages/linux/ssh-copy-id.md @@ -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}}` diff --git a/pages/linux/strace.md b/pages/linux/strace.md index c50915d40..4e17a77f0 100644 --- a/pages/linux/strace.md +++ b/pages/linux/strace.md @@ -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` diff --git a/pages/linux/timedatectl.md b/pages/linux/timedatectl.md new file mode 100644 index 000000000..7d720139e --- /dev/null +++ b/pages/linux/timedatectl.md @@ -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}}` diff --git a/pages/linux/ulimit.md b/pages/linux/ulimit.md new file mode 100644 index 000000000..b5ef0f4bf --- /dev/null +++ b/pages/linux/ulimit.md @@ -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` diff --git a/pages/common/useradd.md b/pages/linux/useradd.md similarity index 100% rename from pages/common/useradd.md rename to pages/linux/useradd.md diff --git a/pages/common/userdel.md b/pages/linux/userdel.md similarity index 100% rename from pages/common/userdel.md rename to pages/linux/userdel.md diff --git a/pages/common/usermod.md b/pages/linux/usermod.md similarity index 100% rename from pages/common/usermod.md rename to pages/linux/usermod.md diff --git a/pages/linux/zypper.md b/pages/linux/zypper.md new file mode 100644 index 000000000..cb012779d --- /dev/null +++ b/pages/linux/zypper.md @@ -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}}` diff --git a/pages/osx/ditto.md b/pages/osx/ditto.md new file mode 100644 index 000000000..ff0bf86c4 --- /dev/null +++ b/pages/osx/ditto.md @@ -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 that’s 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}}` diff --git a/pages/osx/head.md b/pages/osx/head.md index f748591ca..16f5fba16 100644 --- a/pages/osx/head.md +++ b/pages/osx/head.md @@ -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}}` diff --git a/pages/osx/hostname.md b/pages/osx/hostname.md index ed4c36a6c..abc0269c4 100644 --- a/pages/osx/hostname.md +++ b/pages/osx/hostname.md @@ -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 diff --git a/pages/osx/mdfind.md b/pages/osx/mdfind.md index a2c104008..b2eae54dc 100644 --- a/pages/osx/mdfind.md +++ b/pages/osx/mdfind.md @@ -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}}`