neulab/tldr huggingface dataset:
# check progress of an ongoing dd operation (run this command from another shell)
kill -USR1 $(pgrep ^dd)
# download a specific torrent
transmission-cli {{url|magnet|path/to/file}}
# download a torrent to a specific directory
transmission-cli --download-dir {{path/to/download_directory}} {{url|magnet|path/to/file}}
# create a torrent file from a specific file or directory
transmission-cli --new {{path/to/source_file_or_directory}}
# set the download speed limit to 50 kb/s
transmission-cli --downlimit {{50}} {{url|magnet|path/to/file}}
# set the upload speed limit to 50 kb/s
transmission-cli --uplimit {{50}} {{url|magnet|path/to/file}}
# use a specific port for connections
transmission-cli --port {{port_number}} {{url|magnet|path/to/file}}
# force encryption for peer connections
transmission-cli --encryption-required {{url|magnet|path/to/file}}
# use a bluetackformatted peer blocklist
transmission-cli --blocklist {{blocklist_url|path/to/blocklist}} {{url|magnet|path/to/file}}
# replace with the specified command using the current environment variables
exec {{command -with -flags}}
# replace with the specified command, clearing environment variables
exec -c {{command -with -flags}}
# replace with the specified command and login using the default shell
exec -l {{command -with -flags}}
# replace with the specified command and change the process name
exec -a {{process_name}} {{command -with -flags}}
# list all sinks (or other types  sinks are outputs and sinkinputs are active audio streams)
pactl list {{sinks}} short
# change the default sink (output) to 1 (the number can be retrieved via the `list` subcommand)
pactl set-default-sink {{1}}
# move sinkinput 627 to sink 1
pactl move-sink-input {{627}} {{1}}
# set the volume of sink 1 to 75%
pactl set-sink-volume {{1}} {{0.75}}
# toggle mute on the default sink (using the special name `@default_sink@`)
pactl set-sink-mute {{@DEFAULT_SINK@}} toggle
# execute 100 http get requests to a given url
ab -n {{100}} {{url}}
# execute 100 http get requests, in concurrent batches of 10, to a url
ab -n {{100}} -c {{10}} {{url}}
# execute 100 http post requests to a url, using a json payload from a file
ab -n {{100}} -T {{application/json}} -p {{path/to/file.json}} {{url}}
# use http [k]eep alive, i.e. perform multiple requests within one http session
ab -k {{url}}
# set the maximum number of seconds to spend for benchmarking
ab -t {{60}} {{url}}
# build the package or packages defined by the `cargo.toml` manifest file in the current working directory
cargo rustc
# build artifacts in release mode, with optimizations
cargo rustc --release
# compile with architecturespecific optimizations for the current cpu
cargo rustc --release -- -C target-cpu=native
# compile with speed optimization
cargo rustc -- -C opt-level {{1|2|3}}
# compile with [s]ize optimization (`z` also turns off loop vectorization)
cargo rustc -- -C opt-level {{s|z}}
# check if your package uses unsafe code
cargo rustc --lib -- -D unsafe-code
# build a specific package
cargo rustc --package {{package}}
# build only the specified binary
cargo --bin {{name}}
# show the feed of a given url and wait for new entries appearing at the bottom
rsstail -u {{url}}
# show the feed in reverse chronological order (newer at the bottom)
rsstail -r -u {{url}}
# include publication date and link
rsstail -pl -u {{url}}
# set update interval
rsstail -u {{url}} -i {{interval_in_seconds}}
# show feed and exit
rsstail -1 -u {{url}}
# open the npm page of a specific package in the web browser
npm-home {{package}}
# open the github repository of a specific package in the web browser
npm-home -g {{package}}
# open the yarn page of a specific package in the web browser
npm-home -y {{package}}
# show all environment variables
go env
# show a specific environment variable
go env {{GOPATH}}
# set an environment variable to a value
go env -w {{GOBIN}}={{path/to/directory}}
# reset an environment variable's value
go env -u {{GOBIN}}
# create a gpg public and private key interactively
gpg --full-generate-key
# 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`)
gpg --encrypt --recipient {{alice@example.com}} {{doc.txt}}
# encrypt `doc.txt` with only a passphrase (output to `doc.txt.gpg`)
gpg --symmetric {{doc.txt}}
# decrypt `doc.txt.gpg` (output to stdout)
gpg --decrypt {{doc.txt.gpg}}
# import a public key
gpg --import {{public.gpg}}
# export public key for alice@example.com (output to stdout)
gpg --export --armor {{alice@example.com}}
# export private key for alice@example.com (output to stdout)
gpg --export-secret-keys --armor {{alice@example.com}}
# combine several graph layouts (that already have layout information)
gvpack {{path/to/layout1.gv}} {{path/to/layout2.gv ...}} > {{path/to/output.gv}}
# combine several graph layouts at the graph level, keeping graphs separate
gvpack -g {{path/to/layout1.gv}} {{path/to/layout2.gv ...}} > {{path/to/output.gv}}
# combine several graph layouts at the node level, ignoring clusters
gvpack -n {{path/to/layout1.gv}} {{path/to/layout2.gv ...}} > {{path/to/output.gv}}
# combine several graph layouts without packing
gvpack -u {{path/to/layout1.gv}} {{path/to/layout2.gv ...}} > {{path/to/output.gv}}
# display help for `gvpack`
gvpack -?
# assemble an ir file
llvm-as -o {{path/to/out.bc}} {{path/to/source.ll}}
# assemble an ir file and include a module hash in the produced bitcode file
llvm-as --module-hash -o {{path/to/out.bc}} {{path/to/source.ll}}
# read an ir file from `stdin` and assemble it
cat {{path/to/source.ll}} | llvm-as -o {{path/to/out.bc}}
# start an interactive session
iex
# start a session that remembers history
iex --erl "-kernel shell_history enabled"
# start and load mix project files
iex -S mix
# view network settings of an ethernet adapter
ifconfig eth0
# display details of all interfaces, including disabled interfaces
ifconfig -a
# disable eth0 interface
ifconfig eth0 down
# enable eth0 interface
ifconfig eth0 up
# assign ip address to eth0 interface
ifconfig eth0 {{ip_address}}
# join two files on the first (default) field
join {{file1}} {{file2}}
# join two files using a comma (instead of a space) as the field separator
join -t {{','}} {{file1}} {{file2}}
# join field3 of file1 with field1 of file2
join -1 {{3}} -2 {{1}} {{file1}} {{file2}}
# produce a line for each unpairable line for file1
join -a {{1}} {{file1}} {{file2}}
# execute mercurial command
hg {{command}}
# call general help
hg help
# call help on a command
hg help {{command}}
# check the mercurial version
hg --version
# start a new game
blockout2
# navigate the current piece on a 2d plane
{{Up|Down|Left|Right}} arrow key
# rotate the piece on its axis
{{Q|W|E|A|S|D}}
# hard drop the current piece
Spacebar
# show file properties such as size, permissions, creation and access dates among others
stat {{file}}
# same as above but in a more concise way
stat -t {{file}}
# show filesystem information
stat -f {{file}}
# show only octal file permissions
stat -c "%a %n" {{file}}
# show owner and group of the file
stat -c "%U %G" {{file}}
# show the size of the file in bytes
stat -c "%s %n" {{file}}
# initialize an (empty) repository
vcsh init {{repository_name}}
# clone a repository into a custom directory name
vcsh clone {{git_url}} {{repository_name}}
# list all managed repositories
vcsh list
# execute a git command on a managed repository
vcsh {{repository_name}} {{git_command}}
# push/pull all managed repositories to/from remotes
vcsh {{push|pull}}
# write a custom `.gitignore` file for a managed repository
vcsh write-gitignore {{repository_name}}
# add a git repository as a subtree
git subtree add --prefix={{path/to/directory/}} --squash {{repository_url}} {{branch_name}}
# update subtree repository to its latest commit
git subtree pull --prefix={{path/to/directory/}} {{repository_url}} {{branch_name}}
# merge recent changes up to the latest subtree commit into the subtree
git subtree merge --prefix={{path/to/directory/}} --squash {{repository_url}} {{branch_name}}
# push commits to a subtree repository
git subtree push --prefix={{path/to/directory/}} {{repository_url}} {{branch_name}}
# extract a new project history from the history of a subtree
git subtree split --prefix={{path/to/directory/}} {{repository_url}} -b {{branch_name}}
# display logs and changes for recent commits
git whatchanged
# display logs and changes for recent commits within the specified time frame
git whatchanged --since="{{2 hours ago}}"
# display logs and changes for recent commits for specific files or directories
git whatchanged {{path/to/file_or_directory}}
# start mosquitto
mosquitto
# specify a configuration file to use
mosquitto --config-file {{path/to/file.conf}}
# listen on a specific port
mosquitto --port {{8883}}
# daemonize by forking into the background
mosquitto --daemon
# highlight file syntax and print to standard output (language is inferred from the file extension)
pygmentize {{file.py}}
# explicitly set the language for syntax highlighting
pygmentize -l {{javascript}} {{input_file}}
# list available lexers (processors for input languages)
pygmentize -L lexers
# save output to a file in html format
pygmentize -f html -o {{output_file.html}} {{input_file.py}}
# list available output formats
pygmentize -L formatters
# output an html file, with additional formatter options (full page, with line numbers)
pygmentize -f html -O "full,linenos=True" -o {{output_file.html}} {{input_file}}
# compare files (lists changes to turn `old_file` into `new_file`)
diff {{old_file}} {{new_file}}
# compare files, ignoring white spaces
diff --ignore-all-space {{old_file}} {{new_file}}
# compare files, showing the differences side by side
diff --side-by-side {{old_file}} {{new_file}}
# compare files, showing the differences in unified format (as used by `git diff`)
diff --unified {{old_file}} {{new_file}}
# compare directories recursively (shows names for differing files/directories as well as changes made to files)
diff --recursive {{old_directory}} {{new_directory}}
# compare directories, only showing the names of files that differ
diff --recursive --brief {{old_directory}} {{new_directory}}
# create a patch file for git from the differences of two text files, treating nonexistent files as empty
diff --text --unified --new-file {{old_file}} {{new_file}} > {{diff.patch}}
# create a hard link from a new file to an existing file
link {{path/to/existing_file}} {{path/to/new_file}}
# compile a file
go build {{path/to/main.go}}
# compile, specifying the output filename
go build -o {{path/to/binary}} {{path/to/source.go}}
# compile a package
go build -o {{path/to/binary}} {{path/to/package}}
# compile a main package into an executable, with data race detection
go build -race -o {{path/to/executable}} {{path/to/main/package}}
# install a role
ansible-galaxy install {{username}}.{{role_name}}
# remove a role
ansible-galaxy remove {{username}}.{{role_name}}
# list installed roles
ansible-galaxy list
# search for a given role
ansible-galaxy search {{role_name}}
# create a new role
ansible-galaxy init {{role_name}}
# get information about a user role
ansible-galaxy role info {{username}}.{{role_name}}
# get information about a collection
ansible-galaxy collection info {{username}}.{{collection_name}}
# lint a file or directory recursively
flake8 {{path/to/file_or_directory}}
# lint a file or directory recursively and show the line on which each error occurred
flake8 --show-source {{path/to/file_or_directory}}
# lint a file or directory recursively and ignore a list of rules. (all available rules can be found at flake8rules.com)
flake8 --ignore {{rule1,rule2}} {{path/to/file_or_directory}}
# lint a file or directory recursively but exclude files matching the given globs or substrings
flake8 --exclude {{substring1,glob2}} {{path/to/file_or_directory}}
# open a pdf file
xpdf {{path/to/file.pdf}}
# open a specific page in a pdf file
xpdf {{path/to/file.pdf}} :{{page_number}}
# open a compressed pdf file
xpdf {{path/to/file.pdf.tar}}
# open a pdf file in fullscreen mode
xpdf -fullscreen {{path/to/file.pdf}}
# specify the initial zoom
xpdf -z {{75}}% {{path/to/file.pdf}}
# specify the initial zoom at page width or full page
xpdf -z {{page|width}} {{path/to/file.pdf}}
# print a file to the console in rainbow colors
lolcat {{path/to/file}}
# print the result of a textproducing command in rainbow colors
{{fortune}} | lolcat
# print a file to the console with animated rainbow colors
lolcat -a {{path/to/file}}
# print a file to the console with 24bit (truecolor) rainbow colors
lolcat -t {{path/to/file}}
# show help
docker system
# show docker disk usage
docker system df
# show detailed information on disk usage
docker system df --verbose
# remove unused data
docker system prune
# remove unused data created more than a specified amount of time in the past
docker system prune --filter="until={{hours}}h{{minutes}}m"
# display realtime events from the docker daemon
docker system events
# display realtime events from containers streamed as valid json lines
docker system events --filter 'type=container' --format '{{json .}}'
# display systemwide information
docker system info
# initialize a database with a scale factor of 50 times the default size
pgbench --initialize --scale={{50}} {{database_name}}
# benchmark a database with 10 clients, 2 worker threads, and 10,000 transactions per client
pgbench --client={{10}} --jobs={{2}} --transactions={{10000}} {{database_name}}
# set a new environment variable
export {{VARIABLE}}={{value}}
# remove an environment variable
export -n {{VARIABLE}}
# mark a shell function for export
export -f {{FUNCTION_NAME}}
# append something to the path variable
export PATH=$PATH:{{path/to/append}}
# create a new python 3.6.6 virtual environment
pyenv virtualenv {{3.6.6}} {{virtualenv_name}}
# list all existing virtual environments
pyenv virtualenvs
# activate a virtual environment
pyenv activate {{virtualenv_name}}
# deactivate the virtual environment
pyenv deactivate
# create a commit object with the specified message
git commit-tree {{tree}} -m "{{message}}"
# create a commit object reading the message from a file (use `` for stdin)
git commit-tree {{tree}} -F {{path/to/file}}
# create a gpgsigned commit object
git commit-tree {{tree}} -m "{{message}}" --gpg-sign
# create a commit object with the specified parent commit object
git commit-tree {{tree}} -m "{{message}}" -p {{parent_commit_sha}}
# display help about a specific git subcommand
git help {{subcommand}}
# display help about a specific git subcommand in a web browser
git help --web {{subcommand}}
# display a list of all available git subcommands
git help --all
# list the available guides
git help --guide
# list all possible configuration variables
git help --config
# display a cursor to kill a window when pressing the left mouse button (press any other mouse button to cancel)
xkill
# display a cursor to select a window to kill by pressing any mouse button
xkill -button any
# scan file and output strings to `messages.po`
xgettext {{path/to/input_file}}
# use a different output filename
xgettext --output {{path/to/output_file}} {{path/to/input_file}}
# append new strings to an existing file
xgettext --join-existing --output {{path/to/output_file}} {{path/to/input_file}}
# don't add a header containing metadata to the output file
xgettext --omit-header {{path/to/input_file}}
# check the format of the specified refname
git check-ref-format {{refs/head/refname}}
# print the name of the last branch checked out
git check-ref-format --branch @{-1}
# normalize a refname
git check-ref-format --normalize {{refs/head/refname}}
# view a summary of all the commits made, grouped alphabetically by author name
git shortlog
# view a summary of all the commits made, sorted by the number of commits made
git shortlog -n
# view a summary of all the commits made, grouped by the committer identities (name and email)
git shortlog -c
# view a summary of the last 5 commits (i.e. specify a revision range)
git shortlog HEAD~{{5}}..HEAD
# view all users, emails and the number of commits in the current branch
git shortlog -sne
# view all users, emails and the number of commits in all branches
git shortlog -sne --all
# create a new searchable pdf/a file from a scanned pdf or image file
ocrmypdf {{path/to/input_file}} {{path/to/output.pdf}}
# replace a scanned pdf file with a searchable pdf file
ocrmypdf {{path/to/file.pdf}} {{path/to/file.pdf}}
# skip pages of a mixedformat input pdf file that already contain text
ocrmypdf --skip-text {{path/to/input.pdf}} {{path/to/output.pdf}}
# clean, deskew, and rotate pages of a poor scan
ocrmypdf --clean --deskew --rotate-pages {{path/to/input_file}} {{path/to/output.pdf}}
# set the metadata of the searchable pdf file
ocrmypdf --title "{{title}}" --author "{{author}}" --subject "{{subject}}" --keywords "{{keyword; key phrase; ...}}" {{path/to/input_file}} {{path/to/output.pdf}}
# display help
ocrmypdf --help
# display a mirror of a connected device
scrcpy
# display a mirror of a specific device based on its id or ip address (find it under the `adb devices` command)
scrcpy --serial {{0123456789abcdef|192.168.0.1:5555}}
# start display in fullscreen mode
scrcpy --fullscreen
# rotate the display screen. each incremental value adds a 90 degree counterclockwise rotation
scrcpy --rotation {{0|1|2|3}}
# show touches on physical device
scrcpy --show-touches
# record display screen
scrcpy --record {{path/to/file.mp4}}
# set target directory for pushing files to device by drag and drop (nonapk)
scrcpy --push-target {{path/to/directory}}
# connect to an ftp server
ftp {{ftp.example.com}}
# switch to binary transfer mode (graphics, compressed files, etc)
binary
# transfer multiple files without prompting for confirmation on every file
prompt off
# download multiple files (glob expression)
mget {{*.png}}
# upload multiple files (glob expression)
mput {{*.zip}}
# delete multiple files on the remote server
mdelete {{*.txt}}
# rename a file on the remote server
rename {{original_filename}} {{new_filename}}
# show commits (and their messages) with equivalent commits upstream
git cherry -v
# specify a different upstream and topic branch
git cherry {{origin}} {{topic}}
# limit commits to those within a given limit
git cherry {{origin}} {{topic}} {{base}}
# show the environment
env
# run a program. often used in scripts after the shebang (#!) for looking up the path to the program
env {{program}}
# clear the environment and run a program
env -i {{program}}
# remove variable from the environment and run a program
env -u {{variable}} {{program}}
# set a variable and run a program
env {{variable}}={{value}} {{program}}
# set multiple variables and run a program
env {{variable1}}={{value}} {{variable2}}={{value}} {{variable3}}={{value}} {{program}}
# copy files to the destination
install {{path/to/source}} {{path/to/destination}}
# copy files to the destination, setting their ownership
install -o {{user}} {{path/to/source}} {{path/to/destination}}
# copy files to the destination, setting their group ownership
install -g {{user}} {{path/to/source}} {{path/to/destination}}
# copy files to the destination, setting their `mode`
install -m {{+x}} {{path/to/source}} {{path/to/destination}}
# copy files and apply access/modification times of source to the destination
install -p {{path/to/source}} {{path/to/destination}}
# repeatedly output "message"
yes {{message}}
# repeatedly output "y"
yes
# accept everything prompted by the `aptget` command
yes | sudo apt-get install {{program}}
# show details of pods in a namespace
kubectl describe pods -n {{namespace}}
# show details of nodes in a namespace
kubectl describe nodes -n {{namespace}}
# show the details of a specific pod in a namespace
kubectl describe pods {{pod_name}} -n {{namespace}}
# show the details of a specific node in a namespace
kubectl describe nodes {{node_name}} -n {{namespace}}
# show details of kubernetes objects defined in a yaml manifest
kubectl describe -f {{path/to/manifest}}.yaml
# save an image by redirecting stdout to a tar archive
docker save {{image}}:{{tag}} > {{path/to/file.tar}}
# save an image to a tar archive
docker save --output {{path/to/file.tar}} {{image}}:{{tag}}
# save all tags of the image
docker save --output {{path/to/file.tar}} {{image_name}}
# cherrypick particular tags of an image to save
docker save --output {{path/to/file.tar}} {{image_name:tag1 image_name:tag2 ...}}
# convert a string to a qr code and save to an output file
qrencode -o {{path/to/output_file.png}} {{string}}
# convert an input file to a qr code and save to an output file
qrencode -o {{path/to/output_file.png}} -r {{path/to/input_file}}
# convert a string to a qr code and print it in terminal
qrencode -t ansiutf8 {{string}}
# convert input from pipe to a qr code and print it in terminal
echo {{string}} | qrencode -t ansiutf8
# interactively select a run to see information about the jobs
gh run view
# display information about a specific run
gh run view {{workflow_run_number}}
# display information about the steps of a job
gh run view --job={{job_number}}
# display the log of a job
gh run view --job={{job_number}} --log
# check a specific workflow and exit with a nonzero status if the run failed
gh run view {{workflow_run_number}} --exit-status && {{echo "run pending or passed"}}
# interactively select an active run and wait until it's done
gh run watch
# display the jobs for a run and wait until it's done
gh run watch {{workflow_run_number}}
# rerun a specific workflow
gh run rerun {{workflow_run_number}}
# render a `png` image with a filename based on the input filename and output format (uppercase o)
osage -T {{png}} -O {{path/to/input.gv}}
# render a `svg` image with the specified output filename (lowercase o)
osage -T {{svg}} -o {{path/to/image.svg}} {{path/to/input.gv}}
# render the output in `ps`, `pdf`, `svg`, `fig`, `png`, `gif`, `jpg`, `json`, or `dot` format
osage -T {{format}} -O {{path/to/input.gv}}
# render a `gif` image using stdin and stdout
echo "{{digraph {this -> that} }}" | osage -T {{gif}} > {{path/to/image.gif}}
# display help
osage -?
# open a file
micro {{file}}
# cut the entire line
Ctrl + K
# search for a pattern in the file (press `ctrl + n`/`ctrl + p` to go to next/previous match)
Ctrl + F "{{pattern}}" <Enter>
# execute a command
Ctrl + E {{command}} <Enter>
# perform a substitution in the whole file
Ctrl + E replaceall "{{pattern}}" "{{replacement}}" <Enter>
# quit
Ctrl + Q
# send a get request
xh {{httpbin.org/get}}
# send a post request with a json body (keyvalue pairs are added to a toplevel json object  e.g. `{"name" "john", "age" 25}`)
xh post {{httpbin.org/post}} {{name=john}} {{age:=25}}
# send a get request with query parameters (e.g. `first_param=5&second_param=true`)
xh get {{httpbin.org/get}} {{first_param==5}} {{second_param==true}}
# send a get request with a custom header
xh get {{httpbin.org/get}} {{header-name:header-value}}
# make a get request and save the response body to a file
xh --download {{httpbin.org/json}} --output {{path/to/file}}
# display the current mask in octal notation
umask
# display the current mask in symbolic (humanreadable) mode
umask -S
# change the mask symbolically to allow read permission for all users (the rest of the mask bits are unchanged)
umask {{a+r}}
# set the mask (using octal) to restrict no permissions for the file's owner, and restrict all permissions for everyone else
umask {{077}}
# convert a graph from `gxl` to `gv` format
gxl2gv -o {{output.gv}} {{input.gxl}}
# convert a graph using stdin and stdout
cat {{input.gxl}} | gxl2gv > {{output.gv}}
# display help
gxl2gv -?
# read 4096 bytes from the device starting from 0x8000000
st-flash read {{firmware}}.bin {{0x8000000}} {{4096}}
# write firmware to device starting from 0x8000000
st-flash write {{firmware}}.bin {{0x8000000}}
# erase firmware from device
st-flash erase
# list all available serial ports
pio device list
# list all available logical devices
pio device list --logical
# start an interactive device monitor
pio device monitor
# start an interactive device monitor and listen to a specific port
pio device monitor --port {{/dev/ttyUSBX}}
# start an interactive device monitor and set a specific baud rate (defaults to 9600)
pio device monitor --baud {{57600}}
# start an interactive device monitor and set a specific eol character (defaults to `crlf`)
pio device monitor --eol {{CRLF|CR|LF}}
# go to the menu of the interactive device monitor
Ctrl + T
# search a single directory
fdupes {{directory}}
# search multiple directories
fdupes {{directory1}} {{directory2}}
# search a directory recursively
fdupes -r {{directory}}
# search multiple directories, one recursively
fdupes {{directory1}} -R {{directory2}}
# search recursively for duplicates and display interactive prompt to pick which ones to keep, deleting the others
fdupes -rd {{directory}}
# search recursively and delete duplicates without prompting
fdupes -rdN {{directory}}
# create a virtual machine with 1 gib ram and 12 gib storage and start debian installation
virt-install --name {{vm_name}} --memory {{1024}} --disk path={{path/to/image.qcow2}},size={{12}} --cdrom {{path/to/debian.iso}}
# display the current month's calendar
ical
# convert a gregorian date to a hijri date
ical --gregorian {{yyyymmdd}}
# convert a hirji date to a gregorian date
ical --hijri {{yyyymmdd}}
# apply a commit to the current branch
git cherry-pick {{commit}}
# apply a range of commits to the current branch (see also `git rebase onto`)
git cherry-pick {{start_commit}}~..{{end_commit}}
# apply multiple (nonsequential) commits to the current branch
git cherry-pick {{commit_1}} {{commit_2}}
# add the changes of a commit to the working directory, without creating a commit
git cherry-pick -n {{commit}}
# convert pages 110 into 10 pngs
mutool convert -o {{image%d.png}} {{file.pdf}} {{1-10}}
# convert pages 2, 3 and 5 of a pdf into text in the standard output
mutool draw -F {{txt}} {{file.pdf}} {{2,3,5}}
# concatenate two pdfs
mutool merge -o {{output.pdf}} {{input1.pdf}} {{input2.pdf}}
# query information about all content embedded in a pdf
mutool info {{input.pdf}}
# extract all images, fonts and resources embedded in a pdf out into the current directory
mutool extract {{input.pdf}}
# print the outline (table of contents) of a pdf
mutool show {{input.pdf}} outline
# enable module "foo"
drush en {{foo}}
# uninstall module "foo"
drush pmu {{foo}}
# clear all caches
drush cr
# clear css and javascript caches
drush cc css-js
# restore any files deleted since the last commit
git checkout-index --all
# restore any files deleted or changed since the last commit
git checkout-index --all --force
# restore any files changed since the last commit, ignoring any files that were deleted
git checkout-index --all --force --no-create
# export a copy of the entire tree at the last commit to the specified directory (the trailing slash is important)
git checkout-index --all --force --prefix={{path/to/export_directory/}}
# run a command using the input data as arguments
{{arguments_source}} | xargs {{command}}
# run multiple chained commands on the input data
{{arguments_source}} | xargs sh -c "{{command1}} && {{command2}} | {{command3}}"
# delete all files with a `.backup` extension (`print0` uses a null character to split file names, and `0` uses it as delimiter)
find . -name {{'*.backup'}} -print0 | xargs -0 rm -v
# execute the command once for each input line, replacing any occurrences of the placeholder (here marked as `_`) with the input line
{{arguments_source}} | xargs -I _ {{command}} _ {{optional_extra_arguments}}
# parallel runs of up to `maxprocs` processes at a time; the default is 1. if `maxprocs` is 0, xargs will run as many processes as possible at a time
{{arguments_source}} | xargs -P {{max-procs}} {{command}}
# reset a file to head
git reset-file {{path/to/file}}
# reset a file to a specific commit
git reset-file {{path/to/file}} {{commit_hash}}
# run the default task
gulp
# run individual tasks
gulp {{task}} {{othertask}}
# open a file or directory
atom {{path/to/file_or_directory}}
# open a file or directory in a new window
atom -n {{path/to/file_or_directory}}
# open a file or directory in an existing window
atom --add {{path/to/file_or_directory}}
# open atom in safe mode (does not load any additional packages)
atom --safe
# prevent atom from forking into the background, keeping atom attached to the terminal
atom --foreground
# wait for atom window to close before returning (useful for git commit editor)
atom --wait
# strip nondeterministic information from a file
strip-nondeterminism {{path/to/file}}
# strip nondeterministic information from a file manually specifying the filetype
strip-nondeterminism --type {{filetype}} {{path/to/file}}
# strip nondeterministic information from a file; instead of removing timestamps set them to the specified unix timestamp
strip-nondeterminism --timestamp {{unix_timestamp}} {{path/to/file}}
# start/stop/restart a process
supervisorctl {{start|stop|restart}} {{process_name}}
# start/stop/restart all processes in a group
supervisorctl {{start|stop|restart}} {{group_name}}:*
# show last 100 **bytes** of process stderr
supervisorctl tail -100 {{process_name}} stderr
# keep displaying stdout of a process
supervisorctl tail -f {{process_name}} stdout
# reload process config file to add/remove processes as necessary
supervisorctl update
# reinstall an existing app, keeping its data
adb install -r {{path/to/file.apk}}
# grant all permissions listed in the app manifest
adb install -g {{path/to/file.apk}}
# quickly update an installed package by only updating the parts of the apk that changed
adb install --fastdeploy {{path/to/file.apk}}
# compile a lua source file to lua bytecode
luac -o {{byte_code.luac}} {{source.lua}}
# do not include debug symbols in the output
luac -s -o {{byte_code.luac}} {{source.lua}}
# decode a file that was encoded with `uuencode` and print the result to stdout
uudecode {{path/to/encoded_file}}
# decode a file that was encoded with `uuencode` and write the result to a file
uudecode -o {{path/to/decoded_file}} {{path/to/encoded_file}}
# install a module globally
yarn global add {{module_name}}
# install all dependencies referenced in the `package.json` file (the `install` is optional)
yarn install
# install a module and save it as a dependency to the `package.json` file (add `dev` to save as a dev dependency)
yarn add {{module_name}}@{{version}}
# uninstall a module and remove it from the `package.json` file
yarn remove {{module_name}}
# interactively create a `package.json` file
yarn init
# identify whether a module is a dependency and list other modules that depend upon it
yarn why {{module_name}}
# open two files and show the differences
vimdiff {{file1}} {{file2}}
# move the cursor to the window on the left|right
Ctrl + w {{h|l}}
# jump to the next difference
[c
# jump to the previous difference
]c
# copy the highlighted difference from the other window to the current window
do
# copy the highlighted difference from the current window to the other window
dp
# update all highlights and folds
:diffupdate
# toggle the highlighted code fold
za
# initialize `gitsecret` in a local repository
git secret init
# grant access to the current git user's email
git secret tell -m
# grant access by email
git secret tell {{email}}
# revoke access by email
git secret killperson {{email}}
# list emails with access to secrets
git secret whoknows
# register a secret file
git secret add {{path/to/file}}
# encrypt secrets
git secret hide
# decrypt secret files
git secret reveal
# get the [s]ize of the head commit in bytes
git cat-file -s HEAD
# get the [t]ype (blob, tree, commit, tag) of a given git object
git cat-file -t {{8c442dc3}}
# pretty[p]rint the contents of a given git object based on its type
git cat-file -p {{HEAD~2}}
# run an nginx pod and expose port 80
kubectl run --generator=run-pod/v1 nginx --image=nginx --port 80
# run an nginx pod, setting the test_var environment variable
kubectl run --generator=run-pod/v1 nginx --image=nginx --env="TEST_VAR=testing"
# show api calls that would be made to create an nginx container
kubectl run --generator=run-pod/v1 nginx --image=nginx --dry-run
# run an ubuntu pod interactively, never restart it, and remove it when it exits
kubectl run --generator=run-pod/v1 -it temp-ubuntu --image=ubuntu:20.04 --restart=Never --rm -- /bin/bash
# run an ubuntu pod, overriding the default command with echo, and specifying custom arguments
kubectl run --generator=run-pod/v1 temp-ubuntu --image=ubuntu:20.04 --command -- echo arg1 arg2 arg3
# display the numeric identifier for the current host in hexadecimal
hostid
# issue a certificate using an automatic dns api mode
acme.sh --issue --dns {{gnd_gd}} --domain {{example.com}}
# issue a wildcard certificate (denoted by an asterisk) using an automatic dns api mode
acme.sh --issue --dns {{dns_namesilo}} --domain {{example.com}} --domain {{*.example.com}}
# issue a certificate using a dns alias mode
acme.sh --issue --dns {{dns_cf}} --domain {{example.com}} --challenge-alias {{alias-for-example-validation.com}}
# issue a certificate while disabling automatic cloudflare / google dns polling after the dns record is added by specifying a custom wait time in seconds
acme.sh --issue --dns {{dns_namecheap}} --domain {{example.com}} --dnssleep {{300}}
# issue a certificate using a manual dns mode
acme.sh --issue --dns --domain {{example.com}} --yes-I-know-dns-manual-mode-enough-go-ahead-please
# translate a word (language is detected automatically)
trans "{{word_or_sentence_to_translate}}"
# get a brief translation
trans --brief "{{word_or_sentence_to_translate}}"
# translate a word into french
trans :{{fr}} {{word}}
# translate a word from german to english
trans {{de}}:{{en}} {{Schmetterling}}
# behave like a dictionary to get the meaning of a word
trans -d {{word}}
# return a sorted list of best matching fonts
fc-match -s '{{DejaVu Serif}}'
# describe the format and basic characteristics of an image
identify {{path/to/image}}
# describe the format and verbose characteristics of an image
identify -verbose {{path/to/image}}
# collect dimensions of all jpeg files under current directory
identify -format "%f,%w,%h\n" *.{{jpg}} > {{path/to/filelist.csv}}
# launch ranger
ranger
# show only directories
ranger --show-only-dirs
# change the configuration directory
ranger --confdir={{path/to/directory}}
# change the data directory
ranger --datadir={{path/to/directory}}
# print cpu usage statistics on exit
ranger --profile
# open a new terminal
kitty
# open a terminal with the specified title for the window
kitty --title "{{title}}"
# start the themechooser builtin
kitty +kitten themes
# display an image in the terminal
kitty +kitten icat {{path/to/image}}
# copy the contents of stdin to the clipboard
echo {{example}} | kitty +kitten clipboard
# replace all occurrences of a character in a file, and print the result
tr {{find_character}} {{replace_character}} < {{filename}}
# replace all occurrences of a character from another command's output
echo {{text}} | tr {{find_character}} {{replace_character}}
# map each character of the first set to the corresponding character of the second set
tr '{{abcd}}' '{{jkmn}}' < {{filename}}
# delete all occurrences of the specified set of characters from the input
tr -d '{{input_characters}}' < {{filename}}
# compress a series of identical characters to a single character
tr -s '{{input_characters}}' < {{filename}}
# translate the contents of a file to uppercase
tr "[:lower:]" "[:upper:]" < {{filename}}
# strip out nonprintable characters from a file
tr -cd "[:print:]" < {{filename}}
# take a specific secret key and generate a text file with the secret data
paperkey --secret-key {{path/to/secret_key.gpg}} --output {{path/to/secret_data.txt}}
# take the secret key data in `secret_data.txt` and combine it with the public key to reconstruct the secret key
paperkey --pubring {{path/to/public_key.gpg}} --secrets {{path/to/secret_data.txt}} --output {{secret_key.gpg}}
# export a specific secret key and generate a text file with the secret data
gpg --export-secret-key {{key}} | paperkey --output {{path/to/secret_data.txt}}
# initialize (or reencrypt) the storage using one or more gpg ids
pass init {{gpg_id_1}} {{gpg_id_2}}
# save a new password and additional information (press ctrl + d on a new line to complete)
pass insert --multiline {{path/to/data}}
# edit an entry
pass edit {{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}}
# initialize a new git repository (any changes done by pass will be committed automatically)
pass git init
# install packages from http//atom.io/packages and themes from http//atom.io/themes
apm install {{package_name}}
# remove packages/themes
apm remove {{package_name}}
# upgrade packages/themes
apm upgrade {{package_name}}
# display the commands history list with line numbers
history
# display the last 20 commands (in `zsh` it displays all commands starting from the 20th)
history {{20}}
# clear the commands history list (only for current `bash` shell)
history -c
# overwrite history file with history of current `bash` shell (often combined with `history c` to purge history)
history -w
# delete the history entry at the specified offset
history -d {{offset}}
# view documentation for the original command
tldr clang
# check if an ip address is up, and guess the remote host's operating system
nmap -O {{ip_or_hostname}}
# try to determine whether the specified hosts are up and what their names are
nmap -sn {{ip_or_hostname}} {{optional_another_address}}
# like above, but also run a default 1000port tcp scan if host seems up
nmap {{ip_or_hostname}} {{optional_another_address}}
# also enable scripts, service detection, os fingerprinting and traceroute
nmap -A {{address_or_addresses}}
# assume good network connection and speed up execution
nmap -T4 {{address_or_addresses}}
# scan a specific list of ports (use `p` for all ports `165535`)
nmap -p {{port1,port2,…,portN}} {{address_or_addresses}}
# perform tcp and udp scanning (use `su` for udp only, `sz` for sctp, `so` for ip)
nmap -sSU {{address_or_addresses}}
# perform full port, service, version detection scan with all default nse scripts active against a host to determine weaknesses and info
nmap -sC -sV {{address_or_addresses}}
# compare 2 files
sdiff {{path/to/file1}} {{path/to/file2}}
# compare 2 files, ignoring all tabs and whitespace
sdiff -W {{path/to/file1}} {{path/to/file2}}
# compare 2 files, ignoring whitespace at the end of lines
sdiff -Z {{path/to/file1}} {{path/to/file2}}
# compare 2 files in a caseinsensitive manner
sdiff -i {{path/to/file1}} {{path/to/file2}}
# compare and then merge, writing the output to a new file
sdiff -o {{path/to/merged_file}} {{path/to/file1}} {{path/to/file2}}
# move arguments by one place dropping the first argument
shift
# move arguments by n places dropping the first n arguments
shift {{N}}
# decompose one or more graphs into their connected components
ccomps {{path/to/input1.gv}} {{path/to/input2.gv ...}} > {{path/to/output.gv}}
# print the number of nodes, edges, and connected components in one or more graphs
ccomps -v -s {{path/to/input1.gv}} {{path/to/input2.gv ...}}
# write each connected component to numbered filenames based on `output.gv`
ccomps -x -o {{path/to/output.gv}} {{path/to/input1.gv}} {{path/to/input2.gv ...}}
# display help for `ccomps`
ccomps -?
# optimise the repository
git gc
# aggressively optimise, takes more time
git gc --aggressive
# do not prune loose objects (prunes by default)
git gc --no-prune
# suppress all output
git gc --quiet
# view full usage
git gc --help
# display data about a git repository
git summary
# display data about a git repository since a commitish
git summary {{commit|branch_name|tag_name}}
# display data about a git repository, merging committers using different emails into 1 statistic for each author
git summary --dedup-by-email
# display data about a git repository, showing the number of lines modified by each contributor
git summary --line
# install a package
pip install {{package_name}}
# install a specific version of a package
pip install {{package_name}}=={{package_version}}
# install packages listed in a file
pip install -r {{requirements.txt}}
# install packages from an url or local file archive (.tar.gz | .whl)
pip install -f {{url|path/to/file}}
# install the local package in the current directory in develop (editable) mode
pip install -e .
# display a list of logged in users
users
# display a list of logged in users according to a specific file
users {{/var/log/wmtp}}
# run all tests defined in the cmake project, executing 4 jobs at a time in parallel
ctest -j{{4}} --output-on-failure
# show a list of available tests
ctest -N
# run a single test based on its name, or filter on a regular expression
ctest --output-on-failure -R '^{{test_name}}$'
# convert a graph from `gml` to `gv` format
gml2gv -o {{output.gv}} {{input.gml}}
# convert a graph using stdin and stdout
cat {{input.gml}} | gml2gv > {{output.gv}}
# display help
gml2gv -?
# initialize a swarm cluster
docker swarm init
# display the token to join a manager or a worker
docker swarm join-token {{worker|manager}}
# join a new node to the cluster
docker swarm join --token {{token}} {{manager_node_url:2377}}
# remove a worker from the swarm (run inside the worker node)
docker swarm leave
# display the current ca certificate in pem format
docker swarm ca
# rotate the current ca certificate and display the new certificate
docker swarm ca --rotate
# change the valid period for node certificates
docker swarm update --cert-expiry {{hours}}h{{minutes}}m{{seconds}}s
# wrap each line to default width (80 characters)
fold {{file}}
# wrap each line to width "30"
fold -w30 {{file}}
# wrap each line to width "5" and break the line at spaces (puts each space separated word in a new line, words with length > 5 are wrapped)
fold -w5 -s {{file}}
# convert to utf8 encoding
nkf -w {{path/to/file.txt}}
# convert to shift_jis encoding
nkf -s {{path/to/file.txt}}
# convert to utf8 encoding and overwrite the file
nkf -w --overwrite {{path/to/file.txt}}
# set new line code to lf and overwrite (unix type)
nkf -d --overwrite {{path/to/file.txt}}
# set new line code to crlf and overwrite (windows type)
nkf -c --overwrite {{path/to/file.txt}}
# decrypt mime file and overwrite
nkf -m --overwrite {{path/to/file.txt}}
# update platformio to the latest version
pio upgrade
# update platformio to the latest development (unstable) version
pio upgrade --dev
# get the actual file to which the symlink points
readlink {{filename}}
# get the absolute path to a file
readlink -f {{filename}}
# report only statistics that have a level of concern greater than 0
git sizer
# report all statistics
git sizer -v
# see additional options
git sizer -h
# compute a checksum with bsdcompatible algorithm and 1024byte blocks
sum {{file}}
# compute a checksum with system vcompatible algorithm and 512byte blocks
sum --sysv {{file}}
# set a size of 10 gb to an existing file, or create a new file with the specified size
truncate --size {{10G}} {{filename}}
# extend the file size by 50 mib, fill with holes (which reads as zero bytes)
truncate --size +{{50M}} {{filename}}
# shrink the file by 2 gib, by removing data from the end of file
truncate --size -{{2G}} {{filename}}
# empty the file's content
truncate --size 0 {{filename}}
# empty the file's content, but do not create the file if it does not exist
truncate --no-create --size 0 {{filename}}
# print a text message. note quotes are optional
echo "{{Hello World}}"
# print a message with environment variables
echo "{{My path is $PATH}}"
# print a message without the trailing newline
echo -n "{{Hello World}}"
# append a message to the file
echo "{{Hello World}}" >> {{file.txt}}
# enable interpretation of backslash escapes (special characters)
echo -e "{{Column 1\tColumn 2}}"
# start keepass 2, opening the most recently opened password database
keepass2
# start keepass 2, opening a specific password database
keepass2 {{path/to/database.kbdx}}
# use a specific key file to open a password database
keepass2 {{path/to/database.kbdx}} -keyfile:{{path/to/key/file.key}}
# run a script
coffee {{path/to/file.coffee}}
# compile to javascript and save to a file with the same name
coffee --compile {{path/to/file.coffee}}
# compile to javascript and save to a given output file
coffee --compile {{path/to/file.coffee}} --output {{path/to/file.js}}
# start a repl (interactive shell)
coffee --interactive
# watch script for changes and rerun script
coffee --watch {{path/to/file.coffee}}
# 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}}
# perform a basic analysis check on the current project
pio check
# perform a basic analysis check on a specific project
pio check --project-dir {{project_dir}}
# perform an analysis check for a specific environment
pio check --environment {{environment}}
# perform an analysis check and only report a specified defect severity type
pio check --severity {{low|medium|high}}
# perform an analysis check and show detailed information when processing environments
pio check --verbose
# randomize the order of lines in a file and output the result
shuf {{filename}}
# only output the first 5 entries of the result
shuf --head-count={{5}} {{filename}}
# write the output to another file
shuf {{filename}} --output={{output_filename}}
# generate 3 random numbers in the range 110 (inclusive)
shuf --head-count={{3}} --input-range={{1-10}} --repeat
# set artist and title tag of an mp3 file
id3tag --artist={{artist}} --title={{title}} {{path/to/file.mp3}}
# set album title of all mp3 files in the current directory
id3tag --album={{album}} {{*.mp3}}
# get more help
id3tag --help
# help
git annex help
# initialize a repo with git annex
git annex init
# add a file
git annex add {{path/to/file_or_directory}}
# show the current status of a file or directory
git annex status {{path/to/file_or_directory}}
# synchronize a local repository with a remote
git annex {{remote}}
# get a file or directory
git annex get {{path/to/file_or_directory}}
# open irssi and connect to a server with a nickname
irssi -n {{nickname}} -c {{irc.example.com}}
# open irssi and connect with a specific server on a given port
irssi -c {{irc.example.com}} -p {{port}}
# view the help
irssi --help
# join a channel
/join {{#channelname}}
# change active window (starts at 1)
/win {{window_number}}
# exit the application cleanly and quitting any server(s)
/quit
# print kernel name
uname
# print system architecture and processor information
uname --machine --processor
# print kernel name, kernel release and kernel version
uname --kernel-name --kernel-release --kernel-version
# print system hostname
uname --nodename
# print all available system information
uname --all
# set a secret for the current repository (user will be prompted for the value)
gh secret set {{name}}
# set a secret from a file for the current repository
gh secret set {{name}} < {{path/to/file}}
# set a secret for a specific repository
gh secret set {{name}} --body {{value}} --repo {{owner}}/{{repository}}
# set an organization secret for specific repositories
gh secret set {{name}} --org {{organization}} --repos "{{repository1,repository2,...}}"
# set an organization secret with a specific visibility
gh secret set {{name}} --org {{organization}} --visibility {{all|private|selected}}
# show all references in the default remote repository
git ls-remote
# show only heads references in the default remote repository
git ls-remote --heads
# show only tags references in the default remote repository
git ls-remote --tags
# show all references from a remote repository based on name or url
git ls-remote {{repository_url}}
# show references from a remote repository filtered by a pattern
git ls-remote {{repository_name}} "{{pattern}}"
# delete the underlying storage system for the storage pool specified by name or uuid (determine using `virsh poollist`)
virsh pool-delete --pool {{name|uuid}}
# start an interactive shell session
zsh
# execute a command and then exit
zsh -c "{{command}}"
# execute a script
zsh {{path/to/script.zsh}}
# execute a script, printing each command before executing it
zsh --xtrace {{path/to/script.zsh}}
# start an interactive shell session in verbose mode, printing each command before executing it
zsh --verbose
# create and switch to a new branch
git checkout -b {{branch_name}}