neulab/tldr huggingface dataset:
# delete a shared memory segment by id
ipcrm --shmem-id {{shmem_id}}
# delete a shared memory segment by key
ipcrm --shmem-key {{shmem_key}}
# delete an ipc queue by id
ipcrm --queue-id {{ipc_queue_id}}
# delete an ipc queue by key
ipcrm --queue-key {{ipc_queue_key}}
# delete a semaphore by id
ipcrm --semaphore-id {{semaphore_id}}
# delete a semaphore by key
ipcrm --semaphore-key {{semaphore_key}}
# delete all ipc resources
ipcrm --all
# retrieve the xwindows window id of the running firefox window(s)
xdotool search --onlyvisible --name {{firefox}}
# click the right mouse button
xdotool click {{3}}
# get the id of the currently active window
xdotool getactivewindow
# focus on the window with id of 12345
xdotool windowfocus --sync {{12345}}
# type a message, with a 500ms delay for each letter
xdotool type --delay {{500}} "Hello world"
# press the enter key
xdotool key {{KP_Enter}}
# display all information about the elf file
readelf -all {{path/to/binary}}
# display all the headers present in the elf file
readelf --headers {{path/to/binary}}
# display the entries in symbol table section of the elf file, if it has one
readelf --symbols {{path/to/binary}}
# display the information contained in the elf header at the start of the file
readelf --file-header {{path/to/binary}}
# generate a random uuid
uuidd --random
# generate a bulk number of random uuids
uuidd --random --uuids {{number_of_uuids}}
# generate a timebased uuid, based on the current time and mac address of the system
uuidd --time
# edit action can be used to view any file on default mailcap explorer
edit {{filename}}
# with `runmailcap`
run-mailcap --action=edit {{filename}}
# display the search path used to find man pages
manpath
# show the entire global manpath
manpath --global
# install a service
update-rc.d {{mysql}} defaults
# enable a service
update-rc.d {{mysql}} enable
# disable a service
update-rc.d {{mysql}} disable
# forcibly remove a service
update-rc.d -f {{mysql}} remove
# submit a batch job
sbatch {{path/to/job.sh}}
# submit a batch job with a custom name
sbatch --job-name={{myjob}} {{path/to/job.sh}}
# submit a batch job with a time limit of 30 minutes
sbatch --time={{00:30:00}} {{path/to/job.sh}}
# submit a job and request multiple nodes
sbatch --nodes={{3}} {{path/to/job.sh}}
# create a new linux group
groupadd {{group_name}}
# create new group with a specific groupid
groupadd {{group_name}} -g {{group_id}}
# list all containers (running and stopped)
ctr containers list
# list all images
ctr images list
# pull an image
ctr images pull {{image}}
# tag an image
ctr images tag {{souce_image}}:{{source_tag}} {{target_image}}:{{target_tag}}
# log in as a user
login {{user}}
# log in as user without authentication if user is preauthenticated
login -f {{user}}
# log in as user and preserve environment
login -p {{user}}
# log in as a user on a remote host
login -h {{host}} {{user}}
# print a summary of cpu, memory, hard drive and kernel information
inxi
# print a full description of cpu, memory, disk, network and process information
inxi -Fz
# print information about the distribution's repository
inxi -r
# return the current vmware software version (exit status determines whether the system is a vm or not)
vmware-checkvm
# return the vmware hardware version
vmware-checkvm -h
# enable a virtual host
sudo a2ensite {{virtual_host}}
# don't show informative messages
sudo a2ensite --quiet {{virtual_host}}
# submit a basic interactive job
srun --pty /bin/bash
# submit an interactive job with different attributes
srun --ntasks-per-node={{num_cores}} --mem-per-cpu={{memory_MB}} --pty /bin/bash
# connect to a worker node with a job running
srun --jobid={{job_id}} --pty /bin/bash
# display the current time as reported by the hardware clock
hwclock
# write the current software clock time to the hardware clock (sometimes used during system setup)
hwclock --systohc
# write the current hardware clock time to the software clock
hwclock --hctosys
# connect to a share (user will be prompted for password; `exit` to quit the session)
smbclient {{//server/share}}
# connect with a different username
smbclient {{//server/share}} --user {{username}}
# connect with a different workgroup
smbclient {{//server/share}} --workgroup {{domain}} --user {{username}}
# connect with a username and password
smbclient {{//server/share}} --user {{username%password}}
# download a file from the server
smbclient {{//server/share}} --directory {{path/to/directory}} --command "get {{file.txt}}"
# upload a file to the server
smbclient {{//server/share}} --directory {{path/to/directory}} --command "put {{file.txt}}"
# launch xeyes on the local machine's default display
xeyes
# launch xeyes on a remote machine's display 0, screen 0
xeyes -display {{remote_host}}:{{0}}.{{0}}
# delete a file (send to trash)
trash {{path/to/file}}
# list files in trash
trash-list
# restore file from trash
trash-restore
# empty trash
trash-empty
# empty trash, keeping files trashed less than {{10}} days ago
trash-empty {{10}}
# remove all files named 'foo' from the trash
trash-rm foo
# remove all files with a given original location
trash-rm {{/absolute/path/to/file_or_directory}}
# capture a screenshot and save it to the current directory with the current date as the filename
scrot
# capture a screenshot and save it as `capture.png`
scrot {{capture.png}}
# capture a screenshot interactively
scrot --select
# capture a screenshot from the currently focused window
scrot --focused
# display a countdown of 10 seconds before taking a screenshot
scrot --count --delay {{10}}
# show a brief list of devices
lspci
# display additional info
lspci -v
# display drivers and modules handling each device
lspci -k
# show a specific device
lspci -s {{00:18.3}}
# dump info in a readable form
lspci -vm
# resolve a hostname to an ip address
resolveip {{example.org}}
# resolve an ip address to a hostname
resolveip {{1.1.1.1}}
# silent mode. produces less output
resolveip --silent {{example.org}}
# reserve a file taking up 700 mib of disk space
fallocate --length {{700M}} {{path/to/file}}
# shrink an already allocated file by 200 mib
fallocate --collapse-range --length {{200M}} {{path/to/file}}
# shrink 20 mb of space after 100 mib in a file
fallocate --collapse-range --offset {{100M}} --length {{20M}} {{path/to/file}}
# make a file or directory immutable to changes and deletion, even by superuser
chattr +i {{path/to/file_or_directory}}
# make a file or directory mutable
chattr -i {{path/to/file_or_directory}}
# recursively make an entire directory and contents immutable
chattr -R +i {{path/to/directory}}
# check filesystem, reporting any damaged blocks
e2fsck {{/dev/sdXN}}
# check filesystem and automatically repair any damaged blocks
e2fsck -p {{/dev/sdXN}}
# check filesystem in read only mode
e2fsck -c {{/dev/sdXN}}
# launch virtmanager
virt-manager
# connect to a hypervisor
virt-manager --connect {{hypervisor_uri}}
# don't fork virtmanager process into background on startup
virt-manager --no-fork
# print debug output
virt-manager --debug
# open the "new vm" wizard
virt-manager --show-domain-creator
# show domain details window
virt-manager --show-domain-editor {{name|id|uuid}}
# show domain performance window
virt-manager --show-domain-performance {{name|id|uuid}}
# show connection details window
virt-manager --show-host-summary
# display the routing table
ip route {{show|list}}
# add a default route using gateway forwarding
sudo ip route add default via {{gateway_ip}}
# add a default route using `eth0`
sudo ip route add default dev {{eth0}}
# add a static route
sudo ip route add {{destination_ip}} via {{gateway_ip}} dev {{eth0}}
# delete a static route
sudo ip route del {{destination_ip}} dev {{eth0}}
# change or replace a static route
sudo ip route {{change|replace}} {{destination_ip}} via {{gateway_ip}} dev {{eth0}}
# show which route will be used by the kernel to reach an ip address
ip route get {{destination_ip}}
# display the list of all the interfaces
bmon -a
# display data transfer rates in bits per second
bmon -b
# set policy to define which network interface(s) is/are displayed
bmon -p {{interface_1,interface_2,interface_3}}
# set interval (in seconds) in which rate per counter is calculated
bmon -R {{2.0}}
# switch to a specified branch, stashing and restoring unstaged changes
git switch {{target_branch}}
# synchronize current branch, automatically merging or rebasing, and stashing and unstashing
git sync
# publish a specified branch to the remote server
git publish {{branch_name}}
# remove a branch from the remote server
git unpublish {{branch_name}}
# list all branches and their publication status
git branches {{glob_pattern}}
# remove the last commit from the history
git undo {{--hard}}
# start the interactive mode, in this mode you can enter the commands directly, with autocompletion
iwctl
# call general help
iwctl --help
# display your wifi stations
iwctl station list
# start looking for networks with a station
iwctl station {{station}} scan
# display the networks found by a station
iwctl station {{station}} get-networks
# connect to a network with a station, if credentials are needed they will be asked
iwctl station {{station}} connect {{network_name}}
# create a new user with a default home directory and prompt the user to set a password
adduser {{username}}
# create a new user without a home directory
adduser --no-create-home {{username}}
# create a new user with a home directory at the specified path
adduser --home {{path/to/home}} {{username}}
# create a new user with the specified shell set as the login shell
adduser --shell {{path/to/shell}} {{username}}
# create a new user belonging to the specified group
adduser --ingroup {{group}} {{username}}
# add an existing user to the specified group
adduser {{username}} {{group}}
# get max, min, mean and median of a single column of numbers
seq 3 | datamash max 1 min 1 mean 1 median 1
# get the mean of a single column of float numbers (floats must use "," and not ".")
echo -e '1.0\n2.5\n3.1\n4.3\n5.6\n5.7' | tr '.' ',' | datamash mean 1
# get the mean of a single column of numbers with a given decimal precision
echo -e '1\n2\n3\n4\n5\n5' | datamash -R {{number_of_decimals_wanted}} mean 1
# get the mean of a single column of numbers ignoring "na" and "nan" (literal) strings
echo -e '1\n2\nNa\n3\nNaN' | datamash --narm mean 1
# start a graphical setup at the default wine location
winetricks
# specify a custom wine directory to run winetricks in
WINEPREFIX={{path/to/wine_directory}} winetricks
# install a windows dll or component to the default wine directory
winetricks {{package}}
# display information about volume groups
vgs
# display all volume groups
vgs -a
# change default display to show more details
vgs -v
# display only specific fields
vgs -o {{field_name_1}},{{field_name_2}}
# append field to default display
vgs -o +{{field_name}}
# suppress heading line
vgs --noheadings
# use separator to separate fields
vgs --separator =
# turn up the master volume by 10%
amixer -D pulse sset Master {{10%+}}
# turn down the master volume by 10%
amixer -D pulse sset Master {{10%-}}
# display 100 decimal digits of archimedes' constant pi
pi
# display a specified number of decimal digits of archimedes' constant pi
pi {{number}}
# display help
pi --help
# display version
pi --version
# display recommended readings
pi --bibliography
# roll a single 20 sided dice
rolldice d{{20}}
# roll two six sided dice and drop the lowest roll
rolldice {{2}}d{{6}}s{{1}}
# roll two 20 sided dice and add a modifier value
rolldice {{2}}d{{20}}{{+5}}
# roll a 20 sided dice two times
rolldice {{2}}xd{{20}}
# display optical drives available to `wodim`
wodim --devices
# record ("burn") an audioonly disc
wodim dev=/dev/{{optical_drive}} -audio {{track*.cdaudio}}
# burn a file to a disc, ejecting the disc once done (some recorders require this)
wodim -eject dev=/dev/{{optical_drive}} -data {{file.iso}}
# burn a file to the disc in an optical drive, potentially writing to multiple discs in succession
wodim -tao dev=/dev/{{optical_drive}} -data {{file.iso}}
# toggle guake visibility
F12
# toggle fullscreen mode
F11
# open a new tab
Ctrl+Shift+T
# close the terminal
Super+X
# go to the previous tab
Ctrl+PageUp
# search the selected text in the browser
Shift+Ctrl+L
# grep a pattern in a compressed file (casesensitive)
zgrep {{pattern}} {{path/to/compressed/file}}
# grep a pattern in a compressed file (caseinsensitive)
zgrep -i {{pattern}} {{path/to/compressed/file}}
# output count of lines containing matched pattern in a compressed file
zgrep -c {{pattern}} {{path/to/compressed/file}}
# display the lines which don’t have the pattern present (invert the search function)
zgrep -v {{pattern}} {{path/to/compressed/file}}
# grep a compressed file for multiple patterns
zgrep -e "{{pattern_1}}" -e "{{pattern_2}}" {{path/to/compressed/file}}
# use extended regular expressions (supporting `?`, `+`, `{}`, `()` and `|`)
zgrep -E {{regular_expression}} {{path/to/file}}
# print 3 lines of [c]ontext around, [b]efore, or [a]fter each match
zgrep -{{C|B|A}} {{3}} {{pattern}} {{path/to/compressed/file}}
# list interfaces with detailed info
ip address
# list interfaces with brief network layer info
ip -brief address
# list interfaces with brief link layer info
ip -brief link
# display the routing table
ip route
# show neighbors (arp table)
ip neighbour
# make an interface up/down
ip link set {{interface}} up/down
# add/delete an ip address to an interface
ip addr add/del {{ip}}/{{mask}} dev {{interface}}
# add a default route
ip route add default via {{ip}} dev {{interface}}
# list vulnerable installed packages on the current host
debsecan
# list vulnerable installed packages of a specific suite
debsecan --suite {{release_code_name}}
# list only fixed vulnerabilities
debsecan --suite {{release_code_name}} --only-fixed
# list only fixed vulnerabilities of unstable ("sid") and mail to root
debsecan --suite {{sid}} --only-fixed --format {{report}} --mailto {{root}} --update-history
# upgrade vulnerable installed packages
sudo apt upgrade $(debsecan --only-fixed --format {{packages}})
# scan for available networks
wpa_cli scan
# show scan results
wpa_cli scan_results
# add a network
wpa_cli add_network {{number}}
# set a network's ssid
wpa_cli set_network {{number}} ssid "{{SSID}}"
# enable network
wpa_cli enable_network {{number}}
# save config
wpa_cli save_config
# get current setting
ctrlaltdel
# set ctrl+alt+del to reboot immediately, without any preparation
sudo ctrlaltdel hard
# set ctrl+alt+del to reboot "normally", giving processes a chance to exit first (send sigint to pid1)
sudo ctrlaltdel soft
# show all messages from this [b]oot
journalctl -b
# show all messages from last [b]oot
journalctl -b -1
# show all messages with priority level 3 (errors) from this [b]oot
journalctl -b --priority={{3}}
# [f]ollow new messages (like `tail f` for traditional syslog)
journalctl -f
# show all messages by a specific [u]nit
journalctl -u {{unit}}
# filter messages within a time range (either timestamp or placeholders like "yesterday")
journalctl --since {{now|today|yesterday|tomorrow}} --until {{YYYY-MM-DD HH:MM:SS}}
# show all messages by a specific process
journalctl _PID={{pid}}
# show all messages by a specific executable
journalctl {{path/to/executable}}
# listen for input on the specified port and write it to the specified file
ncat -l {{port}} > {{path/to/file}}
# accept multiple connections and keep ncat open after they have been closed
ncat -lk {{port}}
# write output of specified file to the specified host on the specified port
ncat {{address}} {{port}} < {{path/to/file}}
# reboot the system
reboot
# power off the system (same as `poweroff`)
reboot --poweroff
# halt the system (same as `halt`)
reboot --halt
# reboot immediately without contacting the system manager
reboot --force --force
# write the wtmp shutdown entry without rebooting the system
reboot --wtmp-only
# display job id, job name, partition, account, number of allocated cpus, job state, and job exit codes for recent jobs
sacct
# display job id, job state, job exit code for recent jobs
sacct --brief
# display the allocations of a job
sacct --jobs {{job_id}} --allocations
# display elapsed time, job name, number of requested cpus, and memory requested of a job
sacct --jobs {{job_id}} --format={{elapsed}},{{jobname}},{{reqcpus}},{{reqmem}}
# list loop devices with detailed info
losetup -a
# attach a file to a given loop device
sudo losetup /dev/{{loop}} /{{path/to/file}}
# attach a file to a new free loop device and scan the device for partitions
sudo losetup --show --partscan -f /{{path/to/file}}
# attach a file to a readonly loop device
sudo losetup --read-only /dev/{{loop}} /{{path/to/file}}
# detach all loop devices
sudo losetup -D
# detach a given loop device
sudo losetup -d /dev/{{loop}}
# get the current backlight value in percent
light
# set the backlight value to 50 percent
light -S {{50}}
# reduce 20 percent from the current backlight value
light -U {{20}}
# add 20 percent to the current backlight value
light -A {{20}}
# list outdated processes
needrestart
# interactively restart services
sudo needrestart
# list outdated processes in [v]erbose or [q]uiet mode
needrestart -{{v|q}}
# check if the [k]ernel is outdated
needrestart -k
# check if the cpu microcode is outdated
needrestart -w
# list outdated processes in [b]atch mode
needrestart -b
# list outdated processed using a specific [c]onfiguration file
needrestart -c {{path/to/config}}
# display help
needrestart --help
# synchronize date and time
sudo htpdate {{host}}
# perform simulation of synchronization, without any action
htpdate -q {{host}}
# compensate the systematisch clock drift
sudo htpdate -x {{host}}
# set time immediate after the synchronization
sudo htpdate -s {{host}}
# enable ufw
ufw enable
# disable ufw
ufw disable
# show ufw rules, along with their numbers
ufw status numbered
# allow incoming traffic on port 5432 on this host with a comment identifying the service
ufw allow {{5432}} comment "{{Service}}"
# allow only tcp traffic from 192.168.0.4 to any address on this host, on port 22
ufw allow proto {{tcp}} from {{192.168.0.4}} to {{any}} port {{22}}
# deny traffic on port 80 on this host
ufw deny {{80}}
# deny all udp traffic to port 22
ufw deny proto {{udp}} from {{any}} to {{any}} port {{22}}
# delete a particular rule. the rule number can be retrieved from the `ufw status numbered` command
ufw delete {{rule_number}}
# view an image
viewnior {{path/to/image.ext}}
# view in fullscreen mode
viewnior --fullscreen {{path/to/image.ext}}
# view fullscreen in slideshow mode
viewnior --slideshow {{path/to/image.ext}}
# cancel a job using its id
scancel {{job_id}}
# cancel all jobs from a user
scancel {{user_name}}
# look for pattern in the database. note the database is recomputed periodically (usually weekly or daily)
locate {{pattern}}
# look for a file by its exact filename (a pattern containing no globbing characters is interpreted as `*pattern*`)
locate */{{filename}}
# recompute the database. you need to do it if you want to find recently added files
sudo updatedb
# query the system information of a remote host using snmpv1 and a community string
snmpwalk -v1 -c {{community}} {{ip}}
# query system information on a remote host by oid using snmpv2 on a specified port
snmpwalk -v2c -c {{community}} {{ip}}:{{port}} {{oid}}
# query system information on a remote host by oid using snmpv3 and authentication without encryption
snmpwalk -v3 -l {{authNoPriv}} -u {{username}} -a {{MD5|SHA}} -A {{passphrase}} {{ip}} {{oid}}
# query system information on a remote host by oid using snmpv3, authentication, and encryption
snmpwalk -v3 -l {{authPriv}} -u {{username}} -a {{MD5|SHA}} -A {{auth_passphrase}} -x {{DES|AES}} -X {{enc_passphrase}} {{ip}} {{oid}}
# query system information on a remote host by oid using snmpv3 without authentication or encryption
snmpwalk -v3 -l {{noAuthNoPriv}} -u {{username}} {{ip}} {{oid}}
# update po files and documents according to the specified config file
po4a {{path/to/config_file}}
# display the mime type of a file
xdg-mime query filetype {{path/to/file}}
# display the default application for opening pngs
xdg-mime query default {{image/png}}
# display the default application for opening a specific file
xdg-mime query default $(xdg-mime query filetype {{path/to/file}})
# set imv as the default application for opening png and jpeg images
xdg-mime default {{imv.desktop}} {{image/png}} {{image/jpeg}}
# show pipe delimited cluster utilization data
sreport --parsable cluster utilization
# show number of jobs run
sreport job sizes printjobcount
# show users with the highest cpu time use
sreport user topuser
# display packages whose support is limited, has already ended or will end earlier than the distribution's end of life
check-support-status
# display only packages whose support has ended
check-support-status --type {{ended}}
# skip printing a headline
check-support-status --no-heading
# toggle play
playerctl play-pause
# next media
playerctl next
# previous media
playerctl previous
# list all players
playerctl --list-all
# send a command to a specific player
playerctl --player={{player_name}} {{command}}
# send a command to all players
playerctl --all-players {{command}}
# show now playing
playerctl metadata --format "Now playing: {{artist}} - {{album}} - {{title}}"
# display power and battery information
upower --dump
# list all power devices
upower --enumerate
# watch for and print power status changes
upower --monitor
# watch for and print detailed power status changes
upower --monitor-detail
# display version
upower --version
# create a new repository (if the repository name is not set, the default name will be the name of the current directory)
gh repo create {{name}}
# clone a repository
gh repo clone {{owner}}/{{repository}}
# fork and clone a repository
gh repo fork {{owner}}/{{repository}} --clone
# view a repository in the web browser
gh repo view {{repository}} --web
# list repositories owned by a specific user or organization (if the owner is not set, the default owner will be the currently logged in user)
gh repo list {{owner}}
# list only nonforks repositories
gh repo list {{owner}} --non-forks
# list repositories with a specific primary coding language
gh repo list {{owner}} --language {{language_name}}
# select full path and size from temporary or config files in a given directory
fselect size, path from {{path/to/directory}} where name = {{'*.cfg'}} or name = {{'*.tmp'}}
# find square images
fselect path from {{path/to/directory}} where width = height
# find oldschool rap 320kbps mp3 files
fselect path from {{path/to/directory}} where genre = {{Rap}} and bitrate = {{320}} and mp3_year lt {{2000}}
# select only the first 5 results and output as json
fselect size, path from {{path/to/directory}} limit {{5}} into json
# use sql aggregate functions to calculate minimum, maximum and average size of files in a directory
fselect "{{MIN(size), MAX(size), AVG(size), SUM(size), COUNT(*)}} from {{path/to/directory}}"
# visit a website
lynx {{example.com}}
# apply restrictions for anonymous account
lynx -anonymous {{example.com}}
# turn on mouse support, if available
lynx -use_mouse {{example.com}}
# force color mode on, if available
lynx -color {{example.com}}
# open a link, using a specific file to read and write cookies
lynx -cookie_file={{path/to/file}} {{example.com}}
# navigate forwards and backwards through the links on a page
Up arrow key, Down arrow key
# go back to the previously displayed page
Left arrow key or u
# exit
q then y
# assemble `source.asm` into a binary file `source`, in the (default) raw binary format
nasm {{source.asm}}
# assemble `source.asm` into a binary file `output_file`, in the specified format
nasm -f {{format}} {{source.asm}} -o {{output_file}}
# list valid output formats (along with basic nasm help)
nasm -hf
# assemble and generate an assembly listing file
nasm -l {{list_file}} {{source.asm}}
# add a directory (must be written with trailing slash) to the include file search path before assembling
nasm -i {{path/to/include_dir/}} {{source.asm}}
# start a service
sudo sv up {{path/to/service}}
# stop a service
sudo sv down {{path/to/service}}
# get service status
sudo sv status {{path/to/service}}
# reload a service
sudo sv reload {{path/to/service}}
# start a service, but only if it's not running and don't restart it if it stops
sudo sv once {{path/to/service}}
# build a project with default build file `build.xml`
ant
# build a project using build file other than `build.xml`
ant -f {{buildfile.xml}}
# print information on possible targets for this project
ant -p
# print debugging information
ant -d
# execute all targets that do not depend on fail target(s)
ant -k
# read an idx file for a git packfile and dump its contents to stdout
git show-index {{path/to/file.idx}}
# specify the hash algorithm for the index file (experimental)
git show-index --object-format={{sha1|sha256}} {{path/to/file}}
# show help
docker rmi
# remove one or more images given their names
docker rmi {{image1 image2 ...}}
# force remove an image
docker rmi --force {{image}}
# remove an image without deleting untagged parents
docker rmi --no-prune {{image}}
# compile a source code file into an executable binary
clang++ {{path/to/source.cpp}} -o {{path/to/output_executable}}
# display (almost) all errors and warnings
clang++ {{path/to/source.cpp}} -Wall -o {{path/to/output_executable}}
# choose a language standard to compile with
clang++ {{path/to/source.cpp}} -std={{c++20}} -o {{path/to/output_executable}}
# include libraries located at a different path than the source file
clang++ {{path/to/source.cpp}} -o {{path/to/output_executable}} -I{{path/to/header_path}} -L{{path/to/library_path}} -l{{path/to/library_name}}
# compile source code into llvm intermediate representation (ir)
clang++ -S -emit-llvm {{path/to/source.cpp}} -o {{path/to/output.ll}}
# insert an additional author to the last git commit
git coauthor {{name}} {{name@example.com}}
# convert a shapefile into a geopackage
ogr2ogr -f GPKG {{output}}.gpkg {{input}}.shp
# change coordinate reference system of a geopackage from `epsg4326` to `epsg3857`
ogr2ogr -s_srs {{EPSG:4326}} -t_srs {{EPSG:3857}} -f GPKG {{output}}.gpkg {{input}}.gpkg
# convert a csv file into a geopackage, specifying the names of the coordinate columns and assigning a coordinate reference system
ogr2ogr -f GPKG {{output}}.gpkg {{input}}.csv -oo X_POSSIBLE_NAMES={{longitude}} -oo Y_POSSIBLE_NAMES={{latitude}} -a_srs {{EPSG:4326}}
# load a geopackage into a postgis database
ogr2ogr -f "PostgreSQL" PG:dbname="{{database_name}}" {{input}}.gpkg
# clip layers of a geopackage file to the given bounding box
ogr2ogr -spat {{min_x}} {{min_y}} {{max_x}} {{max_y}} -f GPKG {{output}}.gpkg {{input}}.gpkg
# display help about environment variables that can be used with `gh`
gh environment
# generate a build recipe in the current directory with `cmakelists.txt` from a project directory
cmake {{path/to/project_directory}}
# generate a build recipe, with build type set to `release` with cmake variable
cmake {{path/to/project_directory}} -D {{CMAKE_BUILD_TYPE=Release}}
# use a generated recipe in a given directory to build artifacts
cmake --build {{path/to/build_directory}}
# install the build artifacts into `/usr/local/` and strip debugging symbols
cmake --install {{path/to/build_directory}} --strip
# install the build artifacts using the custom prefix for paths
cmake --install {{path/to/build_directory}} --strip --prefix {{path/to/directory}}
# run a custom build target
cmake --build {{path/to/build_directory}} --target {{target_name}}
# scan the current local network
arp-scan --localnet
# scan an ip network with a custom bitmask
arp-scan {{192.168.1.1}}/{{24}}
# scan an ip network within a custom range
arp-scan {{127.0.0.0}}-{{127.0.0.31}}
# scan an ip network with a custom net mask
arp-scan {{10.0.0.0}}:{{255.255.255.0}}
# run an elixir file
elixir {{path/to/file}}
# evaluate elixir code by passing it as an argument
elixir -e "{{code}}"
# view documentation for the actual command
tldr bundle
# apply a manifest
puppet apply {{path/to/manifest}}
# execute puppet code
puppet apply --execute {{code}}
# use a specific module and hiera config file
puppet apply --modulepath {{path/to/directory}} --hiera_config {{path/to/file}} {{path/to/manifest}}
# open a file
openscad {{path/to/button.scad}}
# convert a file to stl
openscad -o {{path/to/button.stl}} {{path/to/button.scad}}
# render a file to png in a specific colorscheme
openscad -o {{path/to/button.png}} --colorscheme {{Sunset}} {{path/to/button.scad}}
# diff the changes of two individual commits
git range-diff {{commit_1}}^! {{commit_2}}^!
# diff the changes of ours and theirs from their common ancestor, e.g. after an interactive rebase
git range-diff {{theirs}}...{{ours}}
# diff the changes of two commit ranges, e.g. to check whether conflicts have been resolved appropriately when rebasing commits from `base1` to `base2`
git range-diff {{base1}}..{{rev1}} {{base2}}..{{rev2}}
# encode the contents of a file as base64 and write the result to stdout
base64 {{filename}}
# decode the base64 contents of a file and write the result to stdout
base64 --decode {{filename}}
# encode from stdin
{{somecommand}} | base64
# decode from stdin
{{somecommand}} | base64 --decode
# compile a dvi (device independent file) document from every source
latexmk
# compile a dvi document from a specific source file
latexmk {{source.tex}}
# compile a pdf document
latexmk -pdf {{source.tex}}
# force the generation of a document even if there are errors
latexmk -f {{source.tex}}
# clean up temporary tex files created for a specific tex file
latexmk -c {{source.tex}}
# clean up all temporary tex files in the current directory
latexmk -c
# convert an xls file to csv
in2csv {{data.xls}}
# convert a dbf file to a csv file
in2csv {{data.dbf}} > {{data.csv}}
# convert a specific sheet from an xlsx file to csv
in2csv --sheet={{sheet_name}} {{data.xlsx}}
# pipe a json file to in2csv
cat {{data.json}} | in2csv -f json > {{data.csv}}
# compile resources referenced in `file.gresource.xml` to a .gresource binary
glib-compile-resources {{file.gresource.xml}}
# compile resources referenced in `file.gresource.xml` to a c source file
glib-compile-resources --generate-source {{file.gresource.xml}}
# compile resources in `file.gresource.xml` to a chosen target file, with `.c`, `.h` or `.gresource` extension
glib-compile-resources --generate --target={{file.ext}} {{file.gresource.xml}}
# print a list of resource files referenced in `file.gresource.xml`
glib-compile-resources --generate-dependencies {{file.gresource.xml}}
# display help about using `gh` with mintty
gh mintty
# convert file type
magick {{image.png}} {{image.jpg}}
# resize an image, making a new copy
magick convert -resize {{100x100}} {{image.jpg}} {{image.jpg}}
# create a gif using images
magick {{*.jpg}} {{images.gif}}
# create checkerboard pattern
magick -size {{640x480}} pattern:checkerboard {{checkerboard.png}}
# convert images to individual pdf pages
magick {{*.jpg}} +adjoin {{page-%d.pdf}}
# compress a png with default settings
optipng {{path/to/file.png}}
# compress a png with the best compression
optipng -o{{7}} {{path/to/file.png}}
# compress a png with the fastest compression
optipng -o{{0}} {{path/to/file.png}}
# compress a png and add interlacing
optipng -i {{1}} {{path/to/file.png}}
# compress a png and preserve all metadata (including file timestamps)
optipng -preserve {{path/to/file.png}}
# compress a png and remove all metadata
optipng -strip all {{path/to/file.png}}
# find broken links on https//example.com/
linkchecker {{https://example.com/}}
# also check urls that point to external domains
linkchecker --check-extern {{https://example.com/}}
# ignore urls that match a specific regular expression
linkchecker --ignore-url {{regular_expression}} {{https://example.com/}}
# output results to a csv file
linkchecker --file-output {{csv}}/{{path/to/file}} {{https://example.com/}}
# parse the contents of a url or file
nokogiri {{url|path/to/file}}
# parse as a specific type
nokogiri {{url|path/to/file}} --type {{xml|html}}
# load a specific initialisation file before parsing
nokogiri {{url|path/to/file}} -C {{path/to/config_file}}
# parse using a specific encoding
nokogiri {{url|path/to/file}} --encoding {{encoding}}
# validate using a relax ng file
nokogiri {{url|path/to/file}} --rng {{url|path/to/file}}
# create vagrantfile in current directory with the base vagrant box
vagrant init
# create vagrantfile with the ubuntu 14.04 (trusty tahr) box from hashicorp atlas
vagrant init ubuntu/trusty32
# start and provision the vagrant environment
vagrant up
# suspend the machine
vagrant suspend
# halt the machine
vagrant halt
# connect to machine via ssh
vagrant ssh
# output the ssh configuration file of the running vagrant machine
vagrant ssh-config
# start an interactive shell session
rbash
# execute a command and then exit
rbash -c "{{command}}"
# execute a script
rbash {{path/to/script.sh}}
# execute a script, printing each command before executing it
rbash -x {{path/to/script.sh}}
# execute commands from a script, stopping at the first error
rbash -e {{path/to/script.sh}}
# read and execute commands from stdin
rbash -s
# compress a file into a new file with the `.lzo` suffix
lzop {{file}}
# decompress a file
lzop -d {{file}}.lzo
# compress a file, while specifying the compression level. 0 = worst, 9 = best (default level is 3)
lzop -{{level}} {{file}}
# extract strongly connected components of one or more directed graphs
sccmap -S {{path/to/input1.gv}} {{path/to/input2.gv ...}} > {{path/to/output.gv}}
# print statistics about a graph, producing no output graph
sccmap -v -s {{path/to/input1.gv}} {{path/to/input2.gv ...}}
# display help for `sccmap`
sccmap -?
# compile a source file into an executable
iverilog {{source.v}} -o {{executable}}
# also display all warnings
iverilog {{source.v}} -Wall -o {{executable}}
# compile and run explicitly using the vvp runtime
iverilog -o {{executable}} -tvvp {{source.v}}
# compile using verilog library files from a different path
iverilog {{source.v}} -o {{executable}} -I{{path/to/library_directory}}
# preprocess verilog code without compiling
iverilog -E {{source.v}}
# search for an exact string in a file
fgrep {{search_string}} {{path/to/file}}
# search only lines that match entirely in files
fgrep -x {{path/to/file1}} {{path/to/file2}}
# count the number of lines that match the given string in a file
fgrep -c {{search_string}} {{path/to/file}}
# show the line number in the file along with the line matched
fgrep -n {{search_string}} {{path/to/file}}
# display all lines except those that contain the search string
fgrep -v {{search_string}} {{path/to/file}}
# display filenames whose content matches the search string at least once
fgrep -l {{search_string}} {{path/to/file1}} {{path/to/file2}}
# convert a specific `.adoc` file to html (the default output format)
asciidoctor {{path/to/file.adoc}}
# convert a specific `.adoc` file to html and link a css stylesheet
asciidoctor -a stylesheet={{path/to/stylesheet.css}} {{path/to/file.adoc}}
# convert a specific `.adoc` file to embeddable html, removing everything except the body
asciidoctor --embedded {{path/to/file.adoc}}
# convert a specific `.adoc` file to a pdf using the `asciidoctorpdf` library
asciidoctor --backend={{pdf}} --require={{asciidoctor-pdf}} {{path/to/file.adoc}}
# open the front page
/front
# open a subreddit
/r/{{subreddit_name}}
# expand/collapse comments
[space]
# open link
o
# log in
u
# open the help screen
?
# convert file to pdf (the output format is determined by file extension)
pandoc {{input.md}} -o {{output.pdf}}
# force conversion to use a specific format
pandoc {{input.docx}} --to {{gfm}} -o {{output.md}}
# convert to a standalone file with the appropriate headers/footers (for latex, html, etc.)
pandoc {{input.md}} -s -o {{output.tex}}
# list all supported input formats
pandoc --list-input-formats
# list all supported output formats
pandoc --list-output-formats
# join all the lines into a single line, using tab as delimiter
paste -s {{file}}
# join all the lines into a single line, using the specified delimiter
paste -s -d {{delimiter}} {{file}}
# merge two files side by side, each in its column, using tab as delimiter
paste {{file1}} {{file2}}
# merge two files side by side, each in its column, using the specified delimiter
paste -d {{delimiter}} {{file1}} {{file2}}
# merge two files, with lines added alternatively
paste -d '\n' {{file1}} {{file2}}
# create a new p5 collection
p5 new {{collection_name}}
# generate a new p5 project (should be run from collection directory)
p5 generate {{project_name}}
# run the p5 manager server
p5 server
# update libraries to their latest versions
p5 update
# decode a jwt
jwt decode {{jwt_string}}
# decode a jwt as a json string
jwt decode -j {{jwt_string}}
# encode a json string to a jwt
jwt encode --alg {{HS256}} --secret {{1234567890}} '{{json_string}}'
# encode key pair payload to jwt
jwt encode --alg {{HS256}} --secret {{1234567890}} -P key=value
# launch tuir
tuir
# open a subreddit
/{{subreddit_name}}
# open a link
o
# open a specific subreddit on launch
tuir -s {{subreddit_name}}
# open external links using programs defined in the mailcap config
tuir --enable-media
# initialise git lfs
git lfs install
# track files that match a glob
git lfs track '{{*.bin}}'
# change the git lfs endpoint url (useful if the lfs server is separate from the git server)
git config -f .lfsconfig lfs.url {{lfs_endpoint_url}}
# list tracked patterns
git lfs track
# list tracked files that have been committed
git lfs ls-files
# push all git lfs objects to the remote server (useful if errors are encountered)
git lfs push --all {{remote_name}} {{branch_name}}
# fetch all git lfs objects
git lfs fetch
# checkout all git lfs objects
git lfs checkout
# rename an existing git tag locally and remotely
git rename-tag {{old_tag_name}} {{new_tag_name}}
# run a random screensaver
gh screensaver
# run a specific screensaver
gh screensaver --saver {{fireworks|marquee|pipes|pollock|starfield}}
# run the "marquee" screensaver with a specific text and font
gh screensaver --saver {{marquee}} -- --message="{{message}}" --font={{font_name}}
# run the "starfield" screensaver with a specific density and speed
gh screensaver --saver {{starfield}} -- --density {{500}} --speed {{10}}
# list available screensavers
gh screensaver --list
# trim whitespace from a file
cat {{path/to/file}} | git stripspace
# trim whitespace and git comments from a file
cat {{path/to/file}} | git stripspace --strip-comments
# convert all lines in a file into git comments
git stripspace --comment-lines < {{path/to/file}}
# initialize opam for first use
opam init
# search for packages
opam search {{package_name}}
# install a package and all of its dependencies
opam install {{package_name}}
# display detailed information about a package
opam show {{package_name}}
# list all installed packages
opam list
# update the local package database
opam update
# upgrade all installed packages
opam upgrade
# display all commands
opam help
# write a commitgraph file for the packed commits in the repository's local `.git` directory
git commit-graph write
# write a commitgraph file containing all reachable commits
git show-ref --hash | git commit-graph write --stdin-commits
# write a commitgraph file containing all commits in the current commitgraph file along with those reachable from `head`
git rev-parse {{HEAD}} | git commit-graph write --stdin-commits --append
# export a collection to stdout, formatted as json
mongoexport --uri={{connection_string}} --collection={{collection_name}}
# export the documents in the specified collection that match a query to a json file
mongoexport --db={{database_name}} --collection={{collection_name}} --query="{{query_object}}" --out={{path/to/file.json}}
# export documents as a json array instead of one object per line
mongoexport --collection={{collection_name}} --jsonArray
# export documents to a csv file
mongoexport --collection={{collection_name}} --type={{csv}} --fields="{{field1,field2,...}}" --out={{path/to/file.csv}}
# export documents that match the query in the specified file to a csv file, omitting the list of field names on the first line
mongoexport --collection={{collection_name}} --type={{csv}} --fields="{{field1,field2,...}}" --queryFile={{path/to/file}} --noHeaderLine --out={{path/to/file.csv}}
# export documents to stdout, formatted as humanreadable json
mongoexport --uri={{mongodb_uri}} --collection={{collection_name}} --pretty
# display help
mongoexport --help
# compile a lilypond file into a pdf
lilypond {{path/to/file}}
# compile into the specified format
lilypond --formats={{format_dump}} {{path/to/file}}
# compile the specified file, suppressing progress updates
lilypond -s {{path/to/file}}
# compile the specified file, and also specify the output filename
lilypond --output={{path/to/output_file}} {{path/to/input_file}}
# show the current version of lilypond
lilypond --version
# display the start and expiry dates for a domain's certificate
openssl s_client -connect {{host}}:{{port}} 2>/dev/null | openssl x509 -noout -dates
# display the certificate presented by an ssl/tls server
openssl s_client -connect {{host}}:{{port}} </dev/null
# display the complete certificate chain of an https server
openssl s_client -connect {{host}}:443 -showcerts </dev/null
# list currently running docker containers
docker container ls
# start one or more stopped containers
docker container start {{container1_name}} {{container2_name}}
# kill one or more running containers
docker container kill {{container_name}}
# stop one or more running containers
docker container stop {{container_name}}
# pause all processes within one or more containers
docker container pause {{container_name}}
# display detailed information on one or more containers
docker container inspect {{container_name}}
# export a container's filesystem as a tar archive
docker container export {{container_name}}
# create a new image from a container's changes
docker container commit {{container_name}}
# display all available stream info for a media file
ffprobe -v error -show_entries {{input.mp4}}
# display media duration
ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 {{input.mp4}}
# display the frame rate of a video
ffprobe -v error -select_streams v:0 -show_entries stream=avg_frame_rate -of default=noprint_wrappers=1:nokey=1 {{input.mp4}}
# display the width or height of a video
ffprobe -v error -select_streams v:0 -show_entries stream={{width|height}} -of default=noprint_wrappers=1:nokey=1 {{input.mp4}}
# display the average bit rate of a video
ffprobe -v error -select_streams v:0 -show_entries stream=bit_rate -of default=noprint_wrappers=1:nokey=1 {{input.mp4}}
# start screenfetch
screenfetch
# take a screenshot (requires 'scrot')
screenfetch -s
# specify distribution logo
screenfetch -A '{{distribution_name}}'
# specify distribution logo and text
screenfetch -D '{{distribution_name}}'
# strip all color
screenfetch -N
# start with nix expression in `shell.nix` or `default.nix` in the current directory
nix-shell
# run shell command in noninteractive shell and exit
nix-shell --run "{{command}} {{command_arguments}}"
# start with expression in `default.nix` in the current directory
nix-shell {{default.nix}}
# start with packages loaded from nixpkgs
nix-shell --packages {{package_name_1}} {{package_name_2}}
# start with packages loaded from specific nixpkgs revision
nix-shell --packages {{package_names}} -I nixpkgs={{https://github.com/NixOS/nixpkgs/archive/nixpkgs_revision.tar.gz}}
# evaluate rest of file in specific interpreter, for use in `#!scripts` (see <https//nixos.org/manual/nix/stable/#useasainterpreter>)
nix-shell -i {{interpreter}} --packages {{package_names}}
# interactively show the disk usage of the current directory
gdu
# interactively show the disk usage of a given directory
gdu {{path/to/directory}}
# interactively show the disk usage of all mounted disks
gdu --show-disks
# interactively show the disk usage of the current directory but ignore some subdirectories
gdu --ignore-dirs {{path/to/directory1,path/to/directory2,...}}
# ignore paths by regular expression
gdu --ignore-dirs-pattern '{{.*[abc]+}}'
# ignore hidden directories
gdu --no-hidden
# only print the result, do not enter interactive mode
gdu --non-interactive {{path/to/directory}}
# do not show the progress in noninteractive mode (useful in scripts)
gdu --no-progress {{path/to/directory}}
# import a bson data dump from a directory to a mongodb database
mongorestore --db {{database_name}} {{path/to/directory}}
# import a bson data dump from a directory to a given database in a mongodb server host, running at a given port, with user authentication (user will be prompted for password)
mongorestore --host {{database_host:port}} --db {{database_name}} --username {{username}} {{path/to/directory}} --password
# import a collection from a bson file to a mongodb database
mongorestore --db {{database_name}} {{path/to/file}}
# import a collection from a bson file to a given database in a mongodb server host, running at a given port, with user authentication (user will be prompted for password)
mongorestore --host {{database_host:port}} --db {{database_name}} --username {{username}} {{path/to/file}} --password
# parse and execute a php script
php {{file}}
# check syntax on (i.e. lint) a php script
php -l {{file}}
# run php interactively
php -a
# run php code (notes don't use <? ?> tags; escape double quotes with backslash)
php -r "{{code}}"
# start a php builtin web server in the current directory
php -S {{host:port}}
# get a list of installed php extensions
php -m
# display information about the current php configuration
php -i
# display a list of all available commands
php yii {{help}}
# start php's builtin web server for the current yii application
php yii {{serve}}
# generate a controller, views and related files for the crud actions on the specified model class
php yii {{gii/crud}} --modelClass={{ModelName}} --controllerClass={{ControllerName}}
# remove a file after a singlepass overwriting with random data
srm -s {{path/to/file}}
# remove a file after seven passes of overwriting with random data
srm -m {{path/to/file}}
# recursively remove a directory and its contents overwriting each file with a singlepass of random data
srm -r -s {{path/to/directory}}
# prompt before every removal
srm -i {{\*}}
# view documentation for the original command
tldr musescore
# compile a `.java` file
javac {{file.java}}
# compile several `.java` files
javac {{file1.java}} {{file2.java}} {{file3.java}}
# compile all `.java` files in current directory
javac {{*.java}}
# compile a `.java` file and place the resulting class file in a specific directory
javac -d {{path/to/some/directory}} {{file.java}}
# print the contents of a file to the standard output
bat {{file}}
# concatenate several files into the target file
bat {{file1}} {{file2}} > {{target_file}}
# append several files into the target file
bat {{file1}} {{file2}} >> {{target_file}}
# number all output lines
bat -n {{file}}
# syntax highlight a json file
bat --language json {{file.json}}
# display all supported languages
bat --list-languages
# list available action plugins (modules)
ansible-doc --list
# list available plugins of a specific type
ansible-doc --type {{plugin_type}} --list
# show information about a specific action plugin (module)
ansible-doc {{plugin_name}}
# show information about a plugin with a specific type
ansible-doc --type {{plugin_type}} {{plugin_name}}
# show the playbook snippet for action plugin (modules)
ansible-doc --snippet {{plugin_name}}
# show information about an action plugin (module) as json
ansible-doc --json {{plugin_name}}
# print a summary for an image (width, height, and color depth)
pngcheck {{image.png}}
# print information for an image with [c]olorized output
pngcheck -c {{image.png}}
# print [v]erbose information for an image
pngcheck -cvt {{image.png}}
# receive an image from stdin and display detailed information
cat {{path/to/image.png}} | pngcheck -cvt
# [s]earch for pngs within a specific file and display information about them
pngcheck -s {{image.png}}
# search for pngs within another file and e[x]tract them
pngcheck -x {{image.png}}
# open a file
helix {{path/to/file}}
# change the helix theme
:theme {{theme_name}}
# save and quit
:wq<Enter>
# forcequit without saving
:q!<Enter>
# undo the last operation
u
# search for a pattern in the file (press `n`/`n` to go to next/previous match)
/{{search_pattern}}<Enter>
# format the file
:format
# copy standard input to each file, and also to standard output
echo "example" | tee {{path/to/file}}
# append to the given files, do not overwrite
echo "example" | tee -a {{path/to/file}}