neulab/tldr huggingface dataset:
# [a]rchive a file or directory
7z a {{path/to/archive.7z}} {{path/to/file_or_directory}}
# encrypt an existing archive (including filenames)
7z a {{path/to/encrypted.7z}} -p{{password}} -mhe=on {{path/to/archive.7z}}
# e[x]tract an archive preserving the original directory structure
7z x {{path/to/archive.7z}}
# e[x]tract an archive to a specific directory
7z x {{path/to/archive.7z}} -o{{path/to/output}}
# e[x]tract an archive to stdout
7z x {{path/to/archive.7z}} -so
# [a]rchive using a specific archive type
7z a -t{{7z|zip|gzip|bzip2|lzip}} {{path/to/archive.7z}} {{path/to/file_or_directory}}
# [l]ist the contents of an archive
7z l {{path/to/archive.7z}}
# list available archive types
7z i
# create a bundle file that contains all objects and references of a specific branch
git bundle create {{path/to/file.bundle}} {{branch_name}}
# create a bundle file of all branches
git bundle create {{path/to/file.bundle}} --all
# create a bundle file of the last 5 commits of the current branch
git bundle create {{path/to/file.bundle}} -{{5}} {{HEAD}}
# create a bundle file of the latest 7 days
git bundle create {{path/to/file.bundle}} --since={{7.days}} {{HEAD}}
# verify that a bundle file is valid and can be applied to the current repository
git bundle verify {{path/to/file.bundle}}
# print to the standard output the list of references contained in a bundle
git bundle unbundle {{path/to/file.bundle}}
# unbundle a specific branch from a bundle file into the current repository
git pull {{path/to/file.bundle}} {{branch_name}}
# launch a presentation in the terminal from a markdown file
mdp {{presentation.md}}
# disable fading transitions
mdp --nofade {{presentation.md}}
# invert font colors to use in terminals with light background
mdp --invert {{presentation.md}}
# disable transparency in transparent terminals
mdp --notrans {{presentation.md}}
# register the current repository in the user's list of repositories to daily have maintenance run
git maintenance register
# start running maintenance on the current repository
git maintenance start
# halt the background maintenance schedule for the current repository
git maintenance stop
# remove the current repository from the user's maintenance repository list
git maintenance unregister
# run a specific maintenance task on the current repository
git maintenance run --task={{commit-graph|gc|incremental-repack|loose-objects|pack-refs|prefetch}}
# run a shadowsocks proxy by specifying the host, server port, local port, password, and encryption method
ss-local -s {{host}} -p {{server_port}} -l {{local port}} -k {{password}} -m {{encrypt_method}}
# run a shadowsocks proxy by specifying the config file
ss-local -c {{path/to/config/file.json}}
# use a plugin to run the proxy client
ss-local --plugin {{plugin_name}} --plugin-opts {{plugin_options}}
# enable tcp fast open
ss-local --fast-open
# look up the canonical name associated with an email address
git check-mailmap "<{{email@example.com}}>"
# play a file
vlc {{path/to/file}}
# play in fullscreen
vlc --fullscreen {{path/to/file}}
# play muted
vlc --no-audio {{path/to/file}}
# play repeatedly
vlc --loop {{path/to/file}}
# play video from a url
vlc {{https://www.youtube.com/watch?v=oHg5SJYRHA0}}
# generate a `create table` sql statement for a csv file
csvsql {{path/to/data.csv}}
# import a csv file into an sql database
csvsql --insert --db "{{mysql://user:password@host/database}}" {{data.csv}}
# run an sql query on a csv file
csvsql --query "{{select * from 'data'}}" {{data.csv}}
# perform the default task in the `build.xml` file
phing
# initialise a new build file
phing -i {{path/to/build.xml}}
# perform a specific task
phing {{task_name}}
# specify a custom build file path
phing -f {{path/to/build.xml}} {{task_name}}
# specify a log file to output to
phing -b {{path/to/log_file}} {{task_name}}
# specify custom properties to use in the build
phing -D{{property}}={{value}} {{task_name}}
# specify a custom listener class
phing -listener {{class_name}} {{task_name}}
# build using verbose output
phing -verbose {{task_name}}
# log a message to syslog
logger {{message}}
# take input from stdin and log to syslog
echo {{log_entry}} | logger
# send the output to a remote syslog server running at a given port. default port is 514
echo {{log_entry}} | logger --server {{hostname}} --port {{port}}
# use a specific tag for every line logged. default is the name of logged in user
echo {{log_entry}} | logger --tag {{tag}}
# log messages with a given priority. default is `user.notice`. see `man logger` for all priority options
echo {{log_entry}} | logger --priority {{user.warning}}
# analyze text from stdin
echo {{His network looks good}} | alex --stdin
# analyze all files in the current directory
alex
# analyze a specific file
alex {{textfile.md}}
# analyze all markdown files except `example.md`
alex *.md !{{example.md}}
# get information about a domain name
whois {{example.com}}
# get information about an ip address
whois {{8.8.8.8}}
# get abuse contact for an ip address
whois -b {{8.8.8.8}}
# query your system's default name server for an ip address (a record) of the domain
nslookup {{example.com}}
# query a given name server for a ns record of the domain
nslookup -type=NS {{example.com}} {{8.8.8.8}}
# query for a reverse lookup (ptr record) of an ip address
nslookup -type=PTR {{54.240.162.118}}
# query for any available records using tcp protocol
nslookup -vc -type=ANY {{example.com}}
# query a given name server for the whole zone file (zone transfer) of the domain using tcp protocol
nslookup -vc -type=AXFR {{example.com}} {{name_server}}
# query for a mail server (mx record) of the domain, showing details of the transaction
nslookup -type=MX -debug {{example.com}}
# query a given name server on a specific port number for a txt record of the domain
nslookup -port={{port_number}} -type=TXT {{example.com}} {{name_server}}
# display help for package "fmt"
godoc {{fmt}}
# display help for the function "printf" of "fmt" package
godoc {{fmt}} {{Printf}}
# serve documentation as a web server on port 6060
godoc -http=:{{6060}}
# create an index file
godoc -write_index -index_files={{path/to/file}}
# use the given index file to search the docs
godoc -http=:{{6060}} -index -index_files={{path/to/file}}
# clone an svn repository
git svn clone {{https://example.com/subversion_repo}} {{local_dir}}
# clone an svn repository starting at a given revision number
git svn clone -r{{1234}}:HEAD {{https://svn.example.net/subversion/repo}} {{local_dir}}
# update local clone from the remote svn repository
git svn rebase
# fetch updates from the remote svn repository without changing the git head
git svn fetch
# commit back to the svn repository
git svn dcommit
# interactively initialize deployer in the local path (use a framework template with `template={{template}}`)
dep init
# deploy an application to a remote host
dep deploy {{hostname}}
# rollback to the previous working release
dep rollback
# connect to a remote host via ssh
dep ssh {{hostname}}
# list commands
dep list
# run any arbitrary command on the remote hosts
dep run "{{command}}"
# display help for a command
dep help {{command}}
# compile go program in the current directory for all operating systems and architecture combinations
gox
# download and compile a go program from a remote url
gox {{url_1}} {{url_2}}
# compile current directory for a particular operating system
gox -os="{{os}}"
# compile current directory for a single operating system and architecture combination
gox -osarch="{{os}}/{{arch}}"
# download the contents of a url to a file
curl {{http://example.com}} --output {{filename}}
# download a file, saving the output under the filename indicated by the url
curl --remote-name {{http://example.com/filename}}
# download a file, following location redirects, and automatically continuing (resuming) a previous file transfer
curl --remote-name --location --continue-at - {{http://example.com/filename}}
# send formencoded data (post request of type `application/xwwwformurlencoded`). use `data @file_name` or `data @''` to read from stdin
curl --data {{'name=bob'}} {{http://example.com/form}}
# send a request with an extra header, using a custom http method
curl --header {{'X-My-Header: 123'}} --request {{PUT}} {{http://example.com}}
# send data in json format, specifying the appropriate contenttype header
curl --data {{'{"name":"bob"}'}} --header {{'Content-Type: application/json'}} {{http://example.com/users/1234}}
# pass a username and password for server authentication
curl --user myusername:mypassword {{http://example.com}}
# pass client certificate and key for a resource, skipping certificate validation
curl --cert {{client.pem}} --key {{key.pem}} --insecure {{https://example.com}}
# print out the issue
gh issue view {{issue_number}}
# create a new issue in the web browser
gh issue create --web
# list the last 10 issues with the `bug` label
gh issue list --limit {{10}} --label "{{bug}}"
# list closed issues made by a specific user
gh issue list --state closed --author {{username}}
# display the status of issues relevant to the user, in a specific repository
gh issue status --repo {{owner}}/{{repository}}
# reopen an issue
gh issue reopen {{issue_number}}
# calculate the sha384 checksum for a file
sha384sum {{path/to/file}}
# calculate sha384 checksums for multiple files
sha384sum {{path/to/file1}} {{path/to/file2}}
# calculate and save the list of sha384 checksums to a file
sha384sum {{path/to/file1}} {{path/to/file2}} > {{path/to/file.sha384}}
# read a file of sha384 sums and verify all files have matching checksums
sha384sum --check {{path/to/file.sha384}}
# only show a message for files for which verification fails
sha384sum --check --quiet {{path/to/file.sha384}}
# execute the `ls` program literally, even if an `ls` alias exists
command {{ls}}
# display the path to the executable or the alias definition of a specific command
command -v {{command_name}}
# start reading toplevel directory menu
info
# start reading at given menu item node from toplevel directory
info {{menu_item}}
# start reading at second menu item within first menu item manual
info {{first_menu_item}} {{second_menu_item}}
# initialize a new postgresql database cluster
pg_ctl -D {{data_directory}} init
# start a postgresql server
pg_ctl -D {{data_directory}} start
# stop a postgresql server
pg_ctl -D {{data_directory}} stop
# restart a postgresql server
pg_ctl -D {{data_directory}} restart
# reload the postgresql server configuration
pg_ctl -D {{data_directory}} reload
# create a new `resume.json` file in the current working directory
resume init
# validate a `resume.json` against schema tests to ensure it complies with the standard
resume validate
# export a resume locally in a stylized html or pdf format
resume export {{path/to/html_or_pdf}}
# start a web server that serves a local `resume.json`
resume serve
# generate go files by running commands within source files
go generate
# search for a video
youtube-viewer {{search_term}}
# log in to your youtube account
youtube-viewer --login
# watch a video with a specific url in vlc
youtube-viewer --player={{vlc}} {{https://youtube.com/watch?v=dQw4w9WgXcQ}}
# display a search prompt and play the selected video in 720p
youtube-viewer -{{7}}
# create a sparsified compressed image without snapshots from an unsparsified one
virt-sparsify --compress {{path/to/image.qcow2}} {{path/to/image_new.qcow2}}
# sparsify an image inplace
virt-sparsify --in-place {{path/to/image.img}}
# change an author's email and name across the whole git repository
git reauthor --old-email {{old@example.com}} --correct-email {{new@example.com}} --correct-name "{{name}}"
# change the email and name to the ones defined in the git config
git reauthor --old-email {{old@example.com}} --use-config
# change the email and name of all commits, regardless of their original author
git reauthor --all --correct-email {{name@example.com}} --correct-name {{name}}
# print the fifth column (a.k.a. field) in a spaceseparated file
awk '{print $5}' {{filename}}
# print the second column of the lines containing "foo" in a spaceseparated file
awk '/{{foo}}/ {print $2}' {{filename}}
# print the last column of each line in a file, using a comma (instead of space) as a field separator
awk -F ',' '{print $NF}' {{filename}}
# sum the values in the first column of a file and print the total
awk '{s+=$1} END {print s}' {{filename}}
# print every third line starting from the first line
awk 'NR%3==1' {{filename}}
# print different values based on conditions
awk '{if ($1 == "foo") print "Exact match foo"; else if ($1 ~ "bar") print "Partial match bar"; else print "Baz"}' {{filename}}
# print all lines where the 10th column value equals the specified value
awk '($10 == value)'
# print all the lines which the 10th column value is between a min and a max
awk '($10 >= min_value && $10 <= max_value)'
# update the database to a specified migration
dotnet ef database update {{migration}}
# drop the database
dotnet ef database drop
# list available `dbcontext` types
dotnet ef dbcontext list
# generate code for a `dbcontext` and entity types for a database
dotnet ef dbcontext scaffold {{connection_string}} {{provider}}
# add a new migration
dotnet ef migrations add {{name}}
# remove the last migration, rolling back the code changes that were done for the latest migration
dotnet ef migrations remove
# list available migrations
dotnet ef migrations list
# generate a sql script from migrations range
dotnet ef migrations script {{from_migration}} {{to_migration}}
# create new files and add them to the index
git touch {{path/to/file1 path/to/file2 ...}}
# open a file
most {{path/to/file}}
# open several files
most {{path/to/file1}} {{path/to/file2}}
# open a file at the first occurrence of "string"
most {{file}} +/{{string}}
# move through opened files
:O n
# jump to the 100th line
{{100}}j
# edit current file
e
# split the current window in half
<CTRL-x> o
# exit
Q
# scan a web server for common paths with common extensions
dirsearch --url {{url}} --extensions-list
# scan a list of web servers for common paths with the `.php` extension
dirsearch --url-list {{path/to/url-list.txt}} --extensions {{php}}
# scan a web server for userdefined paths with common extensions
dirsearch --url {{url}} --extensions-list --wordlist {{path/to/url-paths.txt}}
# scan a web server using a cookie
dirsearch --url {{url}} --extensions {{php}} --cookie {{cookie}}
# scan a web server using the `head` http method
dirsearch --url {{url}} --extensions {{php}} --http-method {{HEAD}}
# scan a web server, saving the results to a `.json` file
dirsearch --url {{url}} --extensions {{php}} --json-report {{path/to/report.json}}
# pull a playbook from a vcs and execute a default local.yml playbook
ansible-pull -U {{repository_url}}
# pull a playbook from a vcs and execute a specific playbook
ansible-pull -U {{repository_url}} {{playbook}}
# pull a playbook from a vcs at a specific branch and execute a specific playbook
ansible-pull -U {{repository_url}} -C {{branch}} {{playbook}}
# pull a playbook from a vcs, specify hosts file and execute a specific playbook
ansible-pull -U {{repository_url}} -i {{hosts_file}} {{playbook}}
# display the currently logged in user's name
logname
# calculate the sha256 digest for a file, saving the result to a specific file
openssl dgst -sha256 -binary -out {{output_file}} {{input_file}}
# sign a file using an rsa key, saving the result to a specific file
openssl dgst -sign {{private_key_file}} -sha256 -sigopt rsa_padding_mode:pss -out {{output_file}} {{input_file}}
# verify an rsa signature
openssl dgst -verify {{public_key_file}} -signature {{signature_file}} -sigopt rsa_padding_mode:pss {{signature_message_file}}
# sign a file using and ecdsa key
openssl dgst -sign {{private_key_file}} -sha256 -out {{output_file}} {{input_file}}
# verify an ecdsa signature
openssl dgst -verify {{public_key_file}} -signature {{signature_file}} {{signature_message_file}}
# find lines that match pattern in a pdf
pdfgrep {{pattern}} {{file.pdf}}
# include file name and page number for each matched line
pdfgrep --with-filename --page-number {{pattern}} {{file.pdf}}
# do a caseinsensitive search for lines that begin with "foo" and return the first 3 matches
pdfgrep --max-count {{3}} --ignore-case {{'^foo'}} {{file.pdf}}
# find pattern in files with a `.pdf` extension in the current directory recursively
pdfgrep --recursive {{pattern}}
# find pattern on files that match a specific glob in the current directory recursively
pdfgrep --recursive --include {{'*book.pdf'}} {{pattern}}
# start hydra's wizard
hydra-wizard
# guess ssh credentials using a given username and a list of passwords
hydra -l {{username}} -P {{path/to/wordlist.txt}} {{host_ip}} {{ssh}}
# guess telnet credentials using a list of usernames and a single password, specifying a nonstandard port and ipv6
hydra -L {{path/to/usernames.txt}} -p {{password}} -s {{port}} -6 {{host_ip}} {{telnet}}
# guess ftp credentials using usernames and passwords lists, specifying the number of threads
hydra -L {{path/to/usernames.txt}} -P {{path/to/wordlist.txt}} -t {{n_tasks}} {{host_ip}} {{ftp}}
# guess mysql credentials using a username and a passwords list, exiting when a username/password pair is found
hydra -l {{username}} -P {{path/to/wordlist.txt}} -f {{host_ip}} {{mysql}}
# guess rdp credentials using a username and a passwords list, showing each attempt
hydra -l {{username}} -P {{path/to/wordlist.txt}} -V {{rdp://host_ip}}
# guess imap credentials on a range of hosts using a list of colonseparated username/password pairs
hydra -C {{path/to/username_password_pairs.txt}} {{imap://[host_range_cidr]}}
# guess pop3 credentials on a list of hosts using usernames and passwords lists, exiting when a username/password pair is found
hydra -L {{path/to/usernames.txt}} -P {{path/to/wordlist.txt}} -M {{path/to/hosts.txt}} -F {{pop3}}
# add a new user to a password file (will prompt to enter the password)
mosquitto_passwd {{path/to/password_file}} {{username}}
# create the password file if it doesn't already exist
mosquitto_passwd -c {{path/to/password_file}} {{username}}
# delete the specified username instead
mosquitto_passwd -D {{path/to/password_file}} {{username}}
# upgrade an old plaintext password file to a hashed password file
mosquitto_passwd -U {{path/to/password_file}}
# display keyvalue pairs of all environment variables
printenv
# display the value of a specific variable
printenv {{HOME}}
# display the value of a variable and end with nul instead of newline
printenv --null {{HOME}}
# connect to server using a config file
sudo openvpn {{path/to/client.conf}}
# try to set up an insecure peertopeer tunnel on bob.example.com host
sudo openvpn --remote {{alice.example.com}} --dev {{tun1}} --ifconfig {{10.4.0.1}} {{10.4.0.2}}
# connect to the awaiting bob.example.com host without encryption
sudo openvpn --remote {{bob.example.com}} --dev {{tun1}} --ifconfig {{10.4.0.2}} {{10.4.0.1}}
# create a cryptographic key and save it to file
openvpn --genkey --secret {{path/to/key}}
# try to set up a peertopeer tunnel on bob.example.com host with a static key
sudo openvpn --remote {{alice.example.com}} --dev {{tun1}} --ifconfig {{10.4.0.1}} {{10.4.0.2}} --secret {{path/to/key}}
# connect to the awaiting bob.example.com host with the same static key as on bob.example.com
sudo openvpn --remote {{bob.example.com}} --dev {{tun1}} --ifconfig {{10.4.0.2}} {{10.4.0.1}} --secret {{path/to/key}}
# show the repository browser for the current git repository
gitk
# show repository browser for a specific file or directory
gitk {{path/to/file_or_directory}}
# show commits made since 1 week ago
gitk --since="{{1 week ago}}"
# show commits older than 1/1/2016
gitk --until="{{1/1/2015}}"
# show at most 100 changes in all branches
gitk --max-count={{100}} --all
# generate a development server that will run at http//localhost4000/
jekyll serve
# enable incremental regeneration
jekyll serve --incremental
# enable verbose output
jekyll serve --verbose
# generate the current directory into `./_site`
jekyll build
# clean the site (removes site output and `cache` directory) without building
jekyll clean
# reverse the text string "hello"
echo "hello" | rev
# reverse an entire file and print to stdout
rev {{file}}
# start the storage pool specified by name or uuid (determine using `virsh poollist`) and create the underlying storage system if it doesn't exist
virsh pool-start --pool {{name|uuid}} --build
# create a new issue against the current repository interactively
gh issue create
# create a new issue with the `bug` label interactively
gh issue create --label "{{bug}}"
# create a new issue interactively and assign it to the specified users
gh issue create --assignee {{user1,user2,...}}
# create a new issue with a title, body and assign it to the current user
gh issue create --title "{{title}}" --body "{{body}}" --assignee "{{@me}}"
# create a new issue interactively, reading the body text from a file
gh issue create --body-file {{path/to/file}}
# create a new issue in the default web browser
gh issue create --web
# display the help
gh issue create --help
# ping a host by arp request packets
arping {{host_ip}}
# ping a host on a specific interface
arping -I {{interface}} {{host_ip}}
# ping a host and stop at the first reply
arping -f {{host_ip}}
# ping a host a specific number of times
arping -c {{count}} {{host_ip}}
# broadcast arp request packets to update neighbours' arp caches
arping -U {{ip_to_broadcast}}
# detect duplicated ip addresses in the network by sending arp requests with a 3 second timeout
arping -D -w {{3}} {{ip_to_check}}
# start an interactive shell session
nu
# execute a command and then exit
nu --commands "{{command}}"
# execute a script
nu {{path/to/script.nu}}
# execute a script with logging
nu --loglevel {{error|warn|info|debug|trace}} {{path/to/script.nu}}
# print the nushell version
nu --version
# copy a disk to a raw image file and hash the image using sha256
dcfldd if=/dev/{{disk_device}} of={{file.img}} hash=sha256 hashlog={{file.hash}}
# copy a disk to a raw image file, hashing each 1 gb chunk
dcfldd if=/dev/{{disk_device}} of={{file.img}} hash={{sha512|sha384|sha256|sha1|md5}} hashlog={{file.hash}} hashwindow={{1G}}
# synchronize once, without enabling autorefresh
offlineimap -o
# synchronize a specific account
offlineimap -a {{account}}
# synchronize a specific folder
offlineimap -f {{folder}}
# send local changes in the current branch to its default remote counterpart
git push
# send changes from a specific local branch to its remote counterpart
git push {{remote_name}} {{local_branch}}
# send changes from a specific local branch to its remote counterpart, and set the remote one as the default push/pull target of the local one
git push -u {{remote_name}} {{local_branch}}
# send changes from a specific local branch to a specific remote branch
git push {{remote_name}} {{local_branch}}:{{remote_branch}}
# send changes on all local branches to their counterparts in a given remote repository
git push --all {{remote_name}}
# delete a branch in a remote repository
git push {{remote_name}} --delete {{remote_branch}}
# remove remote branches that don't have a local counterpart
git push --prune {{remote_name}}
# publish tags that aren't yet in the remote repository
git push --tags
# check if the config files are valid or not (if present report errors)
promtool check config {{config_file.yml}}
# check if the rule files are valid or not (if present report errors)
promtool check rules {{rules_file.yml}}
# pass prometheus metrics over stdin to check them for consistency and correctness
curl --silent {{http://example.com:9090/metrics/}} | promtool check metrics
# unit tests for rules config
promtool test rules {{test_file.yml}}
# initialise the configuration settings
gopass init
# create a new entry
gopass new
# show all stores
gopass mounts
# mount a shared git store
gopass mounts add {{store_name}} {{git_repo_url}}
# search interactively using a keyword
gopass show {{keyword}}
# search using a keyword
gopass find {{keyword}}
# sync all mounted stores
gopass sync
# show a particular password entry
gopass {{store_name|path/to/directory|email@email.com}}
# search for crates
cargo search {{search_string}}
# install a crate
cargo install {{crate_name}}
# list installed crates
cargo install --list
# create a new binary or library rust project in the current directory
cargo init --{{bin|lib}}
# create a new binary or library rust project in the specified directory
cargo new {{path/to/directory}} --{{bin|lib}}
# build the rust project in the current directory
cargo build
# build using a specific number of threads (default is the number of cpu cores)
cargo build --jobs {{number_of_threads}}
# display a notification when tar finishes compressing files
noti {{tar -cjf example.tar.bz2 example/}}
# display a notification even when you put it after the command to watch
{{command_to_watch}}; noti
# monitor a process by pid and trigger a notification when the pid disappears
noti -w {{process_id}}
# show the name of the currently active branch
hg branch
# create a new branch for the next commit
hg branch {{branch_name}}
# play the specified file or url
mplayer {{path/to/file|url}}
# play multiple files
mplayer {{path/to/file1 path/to/file2 ...}}
# play a specific file repeatedly
mplayer -loop {{0}} {{path/to/file}}
# pause playback
<Space>
# quit mplayer
<Escape>
# seek backward or forward 10 seconds
<Left> or <Right>
# list wireless devices and their statuses
sudo airmon-ng
# turn on monitor mode for a specific device
sudo airmon-ng start {{wlan0}}
# kill disturbing processes that use wireless devices
sudo airmon-ng check kill
# turn off monitor mode for a specific network interface
sudo airmon-ng stop {{wlan0mon}}
# build in the current directory
ninja
# build a program in a given directory
ninja -C {{path/to/directory}}
# show targets (e.g. `install` and `uninstall`)
ninja -t targets
# show help
ninja -h
# send a message to a given user on a given terminal id
write {{username}} {{terminal_id}}
# send message to "testuser" on terminal `/dev/tty/5`
write {{testuser}} {{tty/5}}
# send message to "johndoe" on pseudo terminal `/dev/pts/5`
write {{johndoe}} {{pts/5}}
# sort a file in ascending order
sort {{path/to/file}}
# sort a file in descending order
sort --reverse {{path/to/file}}
# sort a file in caseinsensitive way
sort --ignore-case {{path/to/file}}
# sort a file using numeric rather than alphabetic order
sort --numeric-sort {{path/to/file}}
# sort `/etc/passwd` by the 3rd field of each line numerically, using "" as a field separator
sort --field-separator={{:}} --key={{3n}} {{/etc/passwd}}
# sort a file preserving only unique lines
sort --unique {{path/to/file}}
# sort a file, printing the output to the specified output file (can be used to sort a file inplace)
sort --output={{path/to/file}} {{path/to/file}}
# sort numbers with exponents
sort --general-numeric-sort {{path/to/file}}
# open qutebrowser with a specified storage directory
qutebrowser --basedir {{path/to/directory}}
# open a qutebrowser instance with temporary settings
qutebrowser --set {{content.geolocation}} {{true|false}}
# restore a named session of a qutebrowser instance
qutebrowser --restore {{session_name}}
# launch qutebrowser, opening all urls using the specified method
qutebrowser --target {{auto|tab|tab-bg|tab-silent|tab-bg-silent|window|private-window}}
# open qutebrowser with a temporary base directory and print logs to stdout as json
qutebrowser --temp-basedir --json-logging
# connect to a remote server and enter an interactive command mode
sftp {{remote_user}}@{{remote_host}}
# connect using an alternate port
sftp -P {{remote_port}} {{remote_user}}@{{remote_host}}
# transfer remote file to the local system
get {{/path/remote_file}}
# transfer local file to the remote system
put {{/path/local_file}}
# transfer remote directory to the local system recursively (works with `put` too)
get -R {{/path/remote_directory}}
# get list of files on local machine
lls
# get list of files on remote machine
ls
# start a web server instance
hg serve
# start a web server instance on the specified port
hg serve --port {{port}}
# start a web server instance on the specified listening address
hg serve --address {{address}}
# start a web server instance with a specific identifier
hg serve --name {{name}}
# start a web server instance using the specified theme (see the templates directory)
hg serve --style {{style}}
# start a web server instance using the specified ssl certificate bundle
hg serve --certificate {{path/to/certificate}}
# generate a new strongnaming key
sn -k {{path/to/key.snk}}
# resign an assembly with the specified private key
sn -R {{path/to/assembly.dll}} {{path/to/key_pair.snk}}
# show the public key of the private key that was used to sign an assembly
sn -T {{path/to/assembly.exe}}
# extract the public key to a file
sn -e {{path/to/assembly.dll}} {{path/to/output.pub}}
# colorize edges of one or more graph layouts (that already have layout information) to clarify crossing edges
edgepaint {{path/to/layout1.gv}} {{path/to/layout2.gv ...}} > {{path/to/output.gv}}
# colorize edges using a color scheme. (see <https//graphviz.org/doc/info/colors.html#brewer>)
edgepaint -color-scheme={{accent7}} {{path/to/layout.gv}} > {{path/to/output.gv}}
# lay out a graph and colorize its edges, then convert to a png image
dot {{path/to/input.gv}} | edgepaint | dot -T {{png}} > {{path/to/output.png}}
# display help for `edgepaint`
edgepaint -?
# download changes from default remote repository and merge it
git pull
# download changes from default remote repository and use fastforward
git pull --rebase
# download changes from given remote repository and branch, then merge them into head
git pull {{remote_name}} {{branch}}
# show the configuration and status of all zfs zpools
zpool status
# check a zfs pool for errors (verifies the checksum of every block). very cpu and disk intensive
zpool scrub {{pool_name}}
# list zpools available for import
zpool import
# import a zpool
zpool import {{pool_name}}
# export a zpool (unmount all filesystems)
zpool export {{pool_name}}
# show the history of all pool operations
zpool history {{pool_name}}
# create a mirrored pool
zpool create {{pool_name}} mirror {{disk1}} {{disk2}} mirror {{disk3}} {{disk4}}
# add a cache (l2arc) device to a zpool
zpool add {{pool_name}} cache {{cache_disk}}
# convert a bitcode file as llvm ir and write the result to stdout
llvm-dis {{path/to/input.bc}} -o -
# convert a bitcode file to an llvm ir file with the same filename
llvm-dis {{path/to/file.bc}}
# convert a bitcode file to llvm ir, writing the result to the specified file
llvm-dis {{path/to/input.bc}} -o {{path/to/output.ll}}
# print out information about containers
podman ps
# list all containers (both running and stopped)
podman ps --all
# start one or more containers
podman start {{container_name}} {{container_id}}
# stop one or more running containers
podman stop {{container_name}} {{container_id}}
# pull an image from a registry (defaults to the docker hub)
podman pull {{image_name}}:{{image_tag}}
# open a shell inside an already running container
podman exec --interactive --tty {{container_name}} {{sh}}
# remove one or more stopped containers
podman rm {{container_name}} {{container_id}}
# display the logs of one or more containers and follow log output
podman logs --follow {{container_name}} {{container_id}}
# show information about the system firmware and the bootloaders
sudo bootctl status
# set a flag to boot into the system firmware on the next boot (similar to `sudo systemctl reboot firmwaresetup`)
sudo bootctl reboot-to-firmware true
# specify the path to the efi system partition (defaults to `/efi/`, `/boot/` or `/boot/efi`)
sudo bootctl --esp-path={{/path/to/efi_system_partition/}}
# show all available bootloader entries
sudo bootctl list
# install `systemdboot` into the efi system partition
sudo bootctl install
# remove all installed versions of `systemdboot` from the efi system partition
sudo bootctl remove
# erase the existence of specific files
git obliterate {{file_1 file_2 ...}}
# erase the existence of specific files between 2 commits
git obliterate {{file_1 file_2 ...}} -- {{commit_hash_1}}..{{commit_hash_2}}
# create a new directory with the specified branch checked out into it
git worktree add {{path/to/directory}} {{branch}}
# create a new directory with a new branch checked out into it
git worktree add {{path/to/directory}} -b {{new_branch}}
# list all the working directories attached to this repository
git worktree list
# remove a worktree (after deleting worktree directory)
git worktree prune
# run a bash command on file creation, update or deletion
fswatch {{path/to/file}} | xargs -n 1 {{bash_command}}
# watch one or more files and/or directories
fswatch {{path/to/file}} {{path/to/directory}} {{path/to/another_directory/**/*.js}} | xargs -n 1 {{bash_command}}
# print the absolute paths of the changed files
fswatch {{path/to/directory}} | xargs -n 1 -I {} echo {}
# filter by event type
fswatch --event {{Updated|Deleted|Created}} {{path/to/directory}} | xargs -n 1 {{bash_command}}
# open a url
w3m {{http://example.com}}
# open a url in monochrome mode
w3m {{http://example.com}} -M
# open a url without mouse support
w3m {{http://example.com}} --no-mouse
# open a new browser tab
Shift + T
# display your browser history
Ctrl + H
# quit w3m
'q' then 'y'
# open platformio home in the default web browser
pio home
# use a specific http port (defaults to 8008)
pio home --port {{port}}
# bind to a specific ip address (defaults to 127.0.0.1)
pio home --host {{ip_address}}
# do not automatically open platformio home in the default web browser
pio home --no-open
# automatically shutdown the server on timeout (in seconds) when no clients are connected
pio home --shutdown-timeout {{time}}
# specify a unique session identifier to keep platformio home isolated from other instances and protected from 3rd party access
pio home --session-id {{id}}
# execute commands from standard input (press `ctrl + d` when done)
batch
# execute a command from standard input
echo "{{./make_db_backup.sh}}" | batch
# execute commands from a given file
batch -f {{path/to/file}}
# create a new hugo site
hugo new site {{path/to/site}}
# create a new hugo theme (themes may also be downloaded from https//themes.gohugo.io/)
hugo new theme {{theme_name}}
# create a new page
hugo new {{section_name}}/{{filename}}
# build a site to the `./public/` directory
hugo
# build a site including pages that are marked as a "draft"
hugo --buildDrafts
# build a site to a given directory
hugo --destination {{path/to/destination}}
# build a site, start up a webserver to serve it, and automatically reload when pages are edited
hugo server
# run the calculator in interactive mode
eva
# calculate the result of an expression
eva "{{(1 + 2) * 2 ^ 2}}"
# calculate an expression forcing the number of decimal places to 5
eva --fix {{5}} "{{5 / 3}}"
# calculate an expression with sine and cosine
eva "{{sin(1) + cos(1)}}"
# start a server to distribute ebooks. access at http//localhost8080
calibre-server
# start server on different port. access at http//localhostport
calibre-server --port {{port}}
# password protect the server
calibre-server --username {{username}} --password {{password}}
# connect to a remote server
mosh {{username}}@{{remote_host}}
# connect to a remote server with a specific identity (private key)
mosh --ssh="ssh -i {{path/to/key_file}}" {{username}}@{{remote_host}}
# connect to a remote server using a specific port
mosh --ssh="ssh -p {{2222}}" {{username}}@{{remote_host}}
# run a command on a remote server
mosh {{remote_host}} -- {{command -with -flags}}
# select mosh udp port (useful when `{{remote_host}}` is behind a nat)
mosh -p {{124}} {{username}}@{{remote_host}}
# usage when `moshserver` binary is outside standard path
mosh --server={{path/to/bin/}}mosh-server {{remote_host}}
# display all commit hashes and their corresponding commit messages from a specific author
git contrib {{author}}
# change the current user's login shell interactively
chsh
# change the login shell for a given user to zsh
chsh --shell {{/bin/zsh}} {{username}}
# list available shells
chsh --list-shells
# create a new python `virtualenv` in `$workon_home`
mkvirtualenv {{virtualenv_name}}
# create a `virtualenv` for a specific python version
mkvirtualenv --python {{/usr/local/bin/python3.8}} {{virtualenv_name}}
# activate or use a different `virtualenv`
workon {{virtualenv_name}}
# stop the `virtualenv`
deactivate
# list all virtual environments
lsvirtualenv
# remove a `virtualenv`
rmvirtualenv {{virtualenv_name}}
# get summary of all virtualenvwrapper commands
virtualenvwrapper
# write test files to a given directory, filling the drive
f3write {{path/to/mount_point}}
# limit the write speed
f3write --max-write-rate={{kb_per_second}} {{path/to/mount_point}}
# open a file
vim {{path/to/file}}
# open a file at a specified line number
vim +{{line_number}} {{path/to/file}}
# view vim's help manual
:help<Enter>
# perform a regular expression substitution in the whole file
:%s/{{regular_expression}}/{{replacement}}/g<Enter>
# display the line numbers
:set nu<Enter>
# check a shell script
shellcheck {{path/to/script.sh}}
# check a shell script interpreting it as the specified shell dialect (overrides the shebang at the top of the script)
shellcheck --shell {{sh|bash|dash|ksh}} {{path/to/script.sh}}
# ignore one or more error types
shellcheck --exclude {{SC1009,SC1073}} {{path/to/script.sh}}
# also check any sourced shell scripts
shellcheck --checked-sourced {{path/to/script.sh}}
# display output in the specified format (defaults to `tty`)
shellcheck --format {{tty|checkstyle|diff|gcc|json|json1|quiet}} {{path/to/script.sh}}
# enable one or more optional checks
shellcheck --enable={{add-default-case|avoid-nullary-conditions}}
# list all available optional checks that are disabled by default
shellcheck --list-optional
# fetch the latest changes from the default remote upstream repository (if set)
git fetch
# fetch new branches from a specific remote upstream repository
git fetch {{remote_name}}
# fetch the latest changes from all remote upstream repositories
git fetch --all
# also fetch tags from the remote upstream repository
git fetch --tags
# delete local references to remote branches that have been deleted upstream
git fetch --prune
# list your events for all your calendars over the next 7 days
gcalcli agenda
# show events starting from or between specific dates (also takes relative dates e.g. "tomorrow")
gcalcli agenda {{mm/dd}} [{{mm/dd}}]
# list events from a specific calendar
gcalcli --calendar {{calendar_name}} agenda
# display an ascii calendar of events by week
gcalcli calw
# display an ascii calendar of events for a month
gcalcli calm
# quickadd an event to your calendar
gcalcli --calendar {{calendar_name}} quick "{{mm/dd}} {{HH:MM}} {{event_name}}"
# add an event to calendar. triggers interactive prompt
gcalcli --calendar "{{calendar_name}}" add
# remove job number 10
atrm {{10}}
# remove many jobs, separated by spaces
atrm {{15}} {{17}} {{22}}
# run python web app
uvicorn {{import.path:app_object}}
# listen on port 8080 on localhost
uvicorn --host {{localhost}} --port {{8080}} {{import.path:app_object}}
# turn on live reload
uvicorn --reload {{import.path:app_object}}
# use 4 worker processes for handling requests
uvicorn --workers {{4}} {{import.path:app_object}}
# run app over https
uvicorn --ssl-certfile {{cert.pem}} --ssl-keyfile {{key.pem}} {{import.path:app_object}}
# show only the file name from a path
basename {{path/to/file}}
# show only the rightmost directory name from a path
basename {{path/to/directory/}}
# show only the file name from a path, with a suffix removed
basename {{path/to/file}} {{suffix}}
# bring most recently suspended background job to foreground
fg
# bring a specific job to foreground
fg %{{job_id}}
# enable autostart for the storage pool specified by name or uuid (determine using `virsh poollist`)
virsh pool-autostart --pool {{name|uuid}}
# disable autostart for the storage pool specified by name or uuid
virsh pool-autostart --pool {{name|uuid}} --disable
# generate a postscript file from a text file
enscript {{path/to/input_file}} --output={{path/to/output_file}}
# generate a file in a different language than postscript
enscript {{path/to/input_file}} --language={{html|rtf|...}} --output={{path/to/output_file}}
# generate a postscript file with a landscape layout, splitting the page into columns (maximum 9)
enscript {{path/to/input_file}} --columns={{num}} --landscape --output={{path/to/output_file}}
# display available syntax highlighting languages and file formats
enscript --help-highlight
# generate a postscript file with syntax highlighting and color for a specified language
enscript {{path/to/input_file}} --color=1 --highlight={{language}} --output={{path/to/output_file}}
# start a repl (interactive shell)
julia
# execute a julia program and exit
julia {{program.jl}}
# execute a julia program that takes arguments
julia {{program.jl}} {{arguments}}
# evaluate a string containing julia code
julia -e '{{julia_code}}'
# evaluate a string of julia code, passing arguments to it
julia -e '{{for x in ARGS; println(x); end}}' {{arguments}}
# evaluate an expression and print the result
julia -E '{{(1 - cos(pi/4))/2}}'
# start julia in parallel mode, using n worker processes
julia -p {{N}}
# print pdf file fonts information
pdffonts {{path/to/file.pdf}}
# specify user password for pdf file to bypass security restrictions
pdffonts -upw {{password}} {{path/to/file.pdf}}
# specify owner password for pdf file to bypass security restrictions
pdffonts -opw {{password}} {{path/to/file.pdf}}
# print additional information on location of the font that will be used when the pdf file is rasterized
pdffonts -loc {{path/to/file.pdf}}
# print additional information on location of the font that will be used when the pdf file is converted to postscript
pdffonts -locPS {{path/to/file.pdf}}
# execute a java `.class` file that contains a main method by using just the class name
java {{classname}}
# execute a `.jar` program
java -jar {{filename.jar}}
# execute a `.jar` program with debug waiting to connect on port 5005
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005 -jar {{filename.jar}}
# display jdk, jre and hotspot versions
java -version
# display usage information for the java command
java -help
# create a binary from a source file
ocamlc {{path/to/source_file.ml}}
# create a named binary from a source file
ocamlc -o {{path/to/binary}} {{path/to/source_file.ml}}
# automatically generate a module signature (interface) file
ocamlc -i {{path/to/source_file.ml}}
# sign a jar file
jarsigner {{path/to/file.jar}} {{keystore_alias}}
# sign a jar file with a specific algorithm
jarsigner -sigalg {{algorithm}} {{path/to/file.jar}} {{keystore_alias}}
# verify the signature of a jar file
jarsigner -verify {{path/to/file.jar}}
# initialize a new .net project
dotnet new {{template_short_name}}
# restore nuget packages
dotnet restore
# build and execute the .net project in the current directory
dotnet run
# run a packaged dotnet application (only needs the runtime, the rest of the commands require the .net core sdk installed)
dotnet {{path/to/application.dll}}
# generate a 2048bit prime number and display it in hexadecimal
openssl prime -generate -bits 2048 -hex
# check if a given number is prime
openssl prime {{number}}
# list all available and configured networks on docker daemon
docker network ls
# create a userdefined network
docker network create --driver {{driver_name}} {{network_name}}
# display detailed information of a spaceseparated list of networks
docker network inspect {{network_name}}
# connect a container to a network using a name or id
docker network connect {{network_name}} {{container_name|ID}}
# disconnect a container from a network
docker network disconnect {{network_name}} {{container_name|ID}}
# remove all unused (not referenced by any container) networks
docker network prune
# remove a spaceseparated list of unused networks
docker network rm {{network_name}}
# count lines in file
wc -l {{file}}
# count words in file
wc -w {{file}}
# count characters (bytes) in file
wc -c {{file}}
# count characters in file (taking multibyte character sets into account)
wc -m {{file}}
# use standard input to count lines, words and characters (bytes) in that order
{{find .}} | wc
# count the length of the longest line in number of characters
wc --max-line-length {{file}}
# trim some whitespace using a regular expression
{{echo 'lorem ipsum 23   '}} | sd '\s+$' ''
# replace words using capture groups
{{echo 'cargo +nightly watch'}} | sd '(\w+)\s+\+(\w+)\s+(\w+)' 'cmd: $1, channel: $2, subcmd: $3'
# find and replace in a file printing the result to stdout
sd -p {{'window.fetch'}} {{'fetch'}} {{http.js}}
# find and replace across a project changing each file in place
sd {{'from "react"'}} {{'from "preact"'}} $(find . -type f)
# print group memberships for the current user
groups
# print group memberships for a specific user
groups {{username}}
# print group memberships for a list of users
groups {{username1}} {{username2}} {{username3}}
# execute a particular file
mix run {{my_script.exs}}
# create a new project
mix new {{project_name}}
# compile project
mix compile
# run project tests
mix test
# list all mix commands
mix help
# optimise a set of jpeg images, retaining all associated data
jpegoptim {{image1.jpeg}} {{image2.jpeg}} {{imageN.jpeg}}
# optimise jpeg images, stripping all nonessential data
jpegoptim --strip-all {{image1.jpeg}} {{image2.jpeg}} {{imageN.jpeg}}
# force the output images to be progressive
jpegoptim --all-progressive {{image1.jpeg}} {{image2.jpeg}} {{imageN.jpeg}}
# force the output images to have a fixed maximum filesize
jpegoptim --size={{250k}} {{image1.jpeg}} {{image2.jpeg}} {{imageN.jpeg}}
# create a new functions project
func init {{project}}
# create a new function
func new
# run functions locally
func start
# publish your code to a function app in azure
func azure functionapp publish {{function}}
# download all settings from an existing function app
func azure functionapp fetch-app-settings {{function}}
# get the connection string for a specific storage account
func azure storage fetch-connection-string {{storage_account}}
# show the sequence of commits starting from the current one, in reverse chronological order of the git repository in the current working directory
git log
# show the history of a particular file or directory, including differences
git log -p {{path/to/file_or_directory}}
# show an overview of which file(s) changed in each commit
git log --stat
# show a graph of commits in the current branch using only the first line of each commit message
git log --oneline --graph
# show a graph of all commits, tags and branches in the entire repo
git log --oneline --decorate --all --graph
# show only commits whose messages include a given string (caseinsensitively)
git log -i --grep {{search_string}}
# show the last n commits from a certain author
git log -n {{number}} --author={{author}}
# show commits between two dates
git log --before={{date}} --after={{date}}
# enter an interactive shell session on an alreadyrunning container
docker exec --interactive --tty {{container_name}} {{/bin/bash}}
# run a command in the background (detached) on a running container
docker exec --detach {{container_name}} {{command}}
# select the working directory for a given command to execute into
docker exec --interactive -tty --workdir {{path/to/directory}} {{container_name}} {{command}}
# run a command in background on existing container but keep stdin open
docker exec --interactive --detach {{container_name}} {{command}}
# set an environment variable in a running bash session
docker exec --interactive --tty --env {{variable_name}}={{value}} {{container_name}} {{/bin/bash}}
# run a command as a specific user
docker exec --user {{user}} {{container_name}} {{command}}
# extract all members from an archive
ar -x {{path/to/file.a}}
# list the members of an archive
ar -t {{path/to/file.a}}
# replace or add files to an archive
ar -r {{path/to/file.a}} {{path/to/file1.o}} {{path/to/file2.o}}
# insert an object file index (equivalent to using `ranlib`)
ar -s {{path/to/file.a}}
# create an archive with files and an accompanying object file index
ar -rs {{path/to/file.a}} {{path/to/file1.o}} {{path/to/file2.o}}
# switch `runsvdir` directories
sudo runsvchdir {{path/to/directory}}
# start an interactive shell session
bash
# execute a command and then exit
bash -c "{{command}}"
# execute a script
bash {{path/to/script.sh}}
# execute a script, printing each command before executing it
bash -x {{path/to/script.sh}}
# execute commands from a script, stopping at the first error
bash -e {{path/to/script.sh}}