Prezto

Enjoy this cheat sheet at its fullest within Dash, the macOS documentation browser.

Archive

unarchive

Extracts the contents of one or more archives

lsarchive

Lists the contents of one or more archives

Directory

d

Prints the contents of the directory stack

1 ... 9

Changes the directory to the n previous one

Dpkg

debc

Cleans the cache

debf

Displays a file's package

debi

Installs packages from repositories

debI

Installs packages from files

debq

Displays package information

debu

Updates the package lists

debU

Upgrades outdated packages

debx

Removes packages

debX

Removes packages, their configurations and unneeded dependencies

debs

Searches for packages

deb-build

Creates a basic deb package

deb-kclean

Removes all kernel images and headers, except for the ones in use

deb-clone

Generates a script that can be used to duplicate a dpkg-based system

deb-history

Displays dpkg history

deb-kbuild

Makes a dpkg Linux kernel package

Emacs

cai

Installs dependencies

cau

Updates dependencies

caI

Initializes the current directory for dependency management

cae

Executes a command which correct dependencies

Fasd

j

Changes the current working directory interactively

Git

gg

Is short for git

gb

Lists, creates, renames, and deletes branches

gbc

Creates a new branch

gbl

Lists branches and their commits

gbL

Lists local and remote branches and their commits

gbs

Lists branches and their commits with ancestry graphs

gbS

Lists local and remote branches and their commits with ancestry graphs

gbx

Deletes a branch

gbX

Deletes a branch irrespective of its merged status

gbm

Renames a branch

gbM

Renames a branch even if the new branch name already exists

gc

Records changes to the repository

gca

Stages all modified and deleted files

gcm

Records changes to the repository with the given message

gco

Checks out a branch or paths to work tree

gcO

Checks out hunks from the index or the tree interactively

gcf

Amends the tip of the current branch using the same log message as HEAD

gcF

Amends the tip of the current branch

gcp

Applies changes introduced by existing commits

gcP

Applies changes introduced by existing commits without committing

gcr

Reverts existing commits by reverting patches and recording new commits

gcR

Removes the HEAD commit

gcs

Displays various types of objects

gcl

Lists lost commits

gCl

Lists unmerged files

gCa

Adds unmerged file contents to the index

gCe

Executes merge-tool on all unmerged file

gCo

Checks out our changes for unmerged paths

gCO

Checks out our changes for all unmerged paths

gCt

Checks out their changes for unmerged paths

gCT

Checks out their changes for all unmerged paths

gd

Displays information about files in the index and the work tree

gdc

Lists cached files

gdx

Lists deleted files

gdm

Lists modified files

gdu

Lists untracked files

gdk

Lists killed files

gdi

Lists ignored files

gf

Downloads objects and references from another repository

gfc

Clones a repository into a new directory

gfm

Fetches from and merges with another repository or local branch

gfr

Fetches from and rebases on another repository or local branch

gg

Displays lines matching a pattern

ggi

Displays lines matching a pattern ignoring case

ggl

Lists files matching a pattern

ggL

Lists files that are not matching a pattern

ggv

Displays lines not matching a pattern

ggw

Displays lines matching a pattern at word boundary

gia

Adds file contents to the index

giA

Adds file contents to the index interactively

giu

Adds file contents to the index (updates only known files)

gid

Displays changes between the index and a named commit (diff)

giD

Displays changes between the index and a named commit (word diff)

gir

Resets the current HEAD to the specified state

giR

Resets the current index interactively

gix

Removes files/directories from the index (recursively)

giX

Removes files/directories from the index (recursively and forced)

gl

Displays the log

gls

Displays the stats log

gld

Displays the diff log

glo

Displays the one line log

glg

Displays the graph log

glb

Displays the brief commit log

glc

Displays the commit count for each contributor in descending order

gm

Joins two or more development histories together

gmC

Joins two or more development histories together but does not commit

gmF

Joins two or more development histories together but does not commit generating a merge commit even if the merge resolved as a fast-forward

gma

Aborts the conflict resolution, and reconstructs the pre-merge state

gmt

Runs the merge conflict resolution tools to resolve conflicts

gp

Updates remote refs along with associated objects

gpf

Forcefully updates remote refs along with associated objects

gpa

Updates remote branches along with associated objects

gpA

Updates remote branches and tags along with associated objects

gpt

Updates remote tags along with associated objects

gpc

Updates remote refs along with associated objects and adds origin as an upstream reference for the current branch

gpp

Pulls and pushes from origin to origin

gr

Forward-ports local commits to the updated upstream head

gra

Aborts the rebase

grc

Continues the rebase after merge conflicts are resolved

gri

Makes a list of commits to be rebased and opens the editor

grs

Skips the current patch

gR

Manages tracked repositories

gRl

Lists remote names and their URLs

gRa

Adds a new remote

gRx

Removes a remote

gRm

Renames a remote

gRu

Fetches remotes updates

gRp

Prunes all stale remote tracking branches

gRs

Displays information about a given remote

gRb

Opens a remote on GitHub in the default browser

gs

Stashes the changes of the dirty working directory

gsa

Applies the changes recorded in a stash to the working directory

gsx

Drops a stashed state

gsX

Drops all the stashed states

gsl

Lists stashed states

gsL

Lists dropped stashed states

gsd

Displays changes between the stash and its original parent

gsp

Removes and applies a single stashed state from the stash list

gsr

Recovers a given stashed state

gss

Stashes the changes of the dirty working directory, including untracked

gsS

Stashes the changes of the dirty working directory interactively

gsw

Stashes the changes of the dirty working directory retaining the index

gS

Initializes, updates, or inspects submodules

gSa

Adds given a repository as a submodule

gSf

Evaluates a shell command in each of checked out submodules

gSi

Initializes submodules

gSI

Initializes and clones submodules recursively

gSl

Lists the commits of all submodules

gSm

Moves a submodule

gSs

Synchronizes submodules' remote URL to the value specified in .gitmodules

gSu

Fetches and merges the latest changes for all submodule

gSx

Removes a submodule

gws

Displays working-tree status in the short format

gwS

Displays working-tree status

gwd

Displays changes between the working tree and the index (diff)

gwD

Displays changes between the working tree and the index (word diff)

gwr

Resets the current HEAD to the specified state, does not touch the index nor the working tree

gwR

Resets the current HEAD, index and working tree to the specified state

gwc

Removes untracked files from the working tree (dry-run)

gwC

Removes untracked files from the working tree

gwx

Removes files from the working tree and from the index recursively

gwX

Removes files from the working tree and from the index recursively and forcefully

gpt

Shadows the GUID partition table maintenance utility

gs

Shadows the Ghostscript

git-branch-current

Displays the current branch

git-commit-lost

Lists lost commits

git-dir

Displays the path to the Git directory

git-hub-browse

Opens the GitHub repository in the default browser

git-hub-shorten-url

Shortens GitHub URLs

git-info

Exposes repository information via the $git_info associative array

git-root

Displays the path to the working tree root

git-stash-clear-interactive

Asks for confirmation before clearing the stash

git-stash-dropped

Lists dropped stashed states

git-stash-recover

Recovers given dropped stashed states

git-submodule-move

Moves a submodule

git-submodule-remove

Removes a submodule

History

history-stat

Lists the ten most used commands

Homebrew

brewc

Cleans outdated brews and their cached archives

brewC

Cleans outdated brews, including keg-only, and their cached archives

brewi

Installs a formula

brewl

Lists installed formulae

brewo

Lists brews which have an update available

brews

Searches for a formula

brewu

Updates and upgrades Homebrew packages and formulae

brewx

Uninstalls a formula

Homebrew Cask

cask

Is aliased to brew cask

caskc

Cleans up old cached downloads

caskC

Cleans up all cached downloads

caski

Installs a cask

caskl

Lists installed casks

casko

Lists casks which have an update available

casks

Searches for a cask

caskx

Uninstalls a cask

Macports

portc

Cleans the files used to build ports

porti

Installs a port

ports

Searches for a port

portu

Upgrades a port

portU

Upgrades MacPorts, the ports collection, and outdated ports

portx

Uninstalls a port

portX

Uninstalls inactive ports

Node.js

node-doc

Opens the Node.js online API documentation in the default browser

node-info

Exposes information about the Node.js environment via the $node_info associative array

OSX

cdf

Changes the current working director to the current Finder directory

pushdf

Pushes the current working directory onto the directory queue and changes the current working director to the current Finder directory

mand

Opens man pages in Dash.app

manp

Opens man pages in Preview.app

pfd

Prints the current Finder directory

pfs

Prints the current Finder selection

tab

Creates a new tab (works in both Terminal and iTerm)

ql

Previews files in Quick Look

osx-rm-dir-metadata

Deletes .DSStore, _MACOSX cruft

osx-ls-download-history

Displays the macOS download history

osx-rm-download-history

Deletes the macOS download history

Pacman

pac

Is short for pacman

paci

Installs packages from repositories

pacI

Installs packages from files

pacx

Removes packages and unneeded dependencies

pacX

Removes packages, their configuration, and unneeded dependencies

pacq

Displays information about a package from the repositories

pacQ

Displays information about a package from the local database

pacs

Searches for packages in the repositories

pacS

Searches for packages in the local database

pacuabs

Synchronizes the local package and Arch Build System (requires abs) databases against the repositories

pacU

Synchronizes the local package database against the repositories then upgrades outdated packages

pacman-list-orphans

Lists orphan packages

pacman-remove-orphans

Removes orphan packages

pacc

Manages .pac* files

pacman-list-explicit

Lists explicitly installed pacman packages

pacman-list-disowned

Lists pacman disowned files

Perl

pl

Is short for perl

pldperldoc

Looks up Perl documentation (perldoc)

pleperl -wlne

Executes a one line program in a loop (perl -wlne)

plb

Manages Perl environments

plba

Lists available Perl versions

plbi

Installs a Perl version

plbl

Lists installed Perl versions

plbo

Temporarily turns off Perlbrew

plbO

Turns off Perlbrew

plbs

Switches to a Perl version

plbu

Uninstalls a Perl version

plbx

Temporarily sets the Perl version to use

Python

py

Is short for python

python-info

Exposes information about the Python environment via the $python_info associative array

Ruby on Rails

ror

Is short for rails

rorc

Starts the Rails console

rordc

Starts the Rails console connected to the database

rordm

Migrates the database

rordM

Migrates the database and recreates the test database

rordr

Rolls the database schema back to the previous version

rorg

Generates new code

rorl

Displays the log

rorlc

Truncates logs to zero bytes

rorp

Installs a plugin

rorr

Runs code in the application environment

rors

Starts the Rails server

rorsd

Starts the Rails server with the debugger

rorx

Destroys newly generated code

Rsync

rsync-copy

Copies files and directories from source to destination

rsync-move

Moves files and directories from source to destination

rsync-update

Updates files and directories on destination

rsync-synchronize

Synchronizes files and directories between source and destination

Ruby

rb

Is short for ruby

rbb

Manages ruby dependencies (bundle)

rbbe

Executes a script in the context of the current bundle

rbbi

Installs the gems specified in the Gemfile in vendor/bundle

rbbI

Installs the following: - gems specified in the Gemfile in vendor/bundle. - packages the gems into vendor/cache. - appends bundler directories to .gitignore.

rbbl

Lists all gems in the current bundle

rbbo

Opens an installed gem in the editor

rbbp

Packages gem files into vendor/cache

rbbu

Updates gems to their latest version

ruby-app-root

Displays the path to the Ruby application root directory

ruby-info

Exposes information about the Ruby environment via the $ruby_info associative array

Screen

scr

Is short for screen

scrl

Lists sessions/socket directory

scrn

Starts a new session

scrr

Attaches to a session if one exists or start a new one

Terminal

set-tab-title

Sets the terminal tab title

set-window-title

Sets the terminal or terminal multiplexer window title

Tmux

tmuxa

Attaches or switches to a tmux session

tmuxl

Lists sessions managed by the tmux server

Utility

_

Executes a command as another user (sudo)

b

Opens the default web browser

cp

Copies files and directories interactively

e

Opens the default editor

mkdir

Creates directories, including intermediary directories

mv

Moves files and directories interactively

p

Opens the default pager

po

Removes a directory from the stack and changes to it (popd)

pu

Changes the directory and pushes the old directory onto the stack (pushd)

rm

Removes files and directories interactively

type

Displays all the attribute values of a shell parameter

ls

Lists with directories grouped first (GNU only)

l

Lists in one column, hidden files

ll

Lists human readable sizes

lr

Lists human readable sizes, recursively

la

Lists human readable sizes, hidden files

lm

Lists human readable sizes, hidden files through pager

lx

Lists sorted by extension (GNU only)

lk

Lists sorted by size, largest last

lt

Lists sorted by date, most recent last

lc

Lists sorted by date, most recent last, shows change time

lu

Lists sorted by date, most recent last, shows access time

sl

Lists directory contents (ls)

o

Opens files and directories (open or xdg-open)

get

Downloads files (curl or wget)

pbcopy

Copies to the pasteboard (pbcopy, xclip or xsel)

pbpaste

Pastes from the pasteboard (pbcopy, xclip or xsel)

pbc

Copies to the pasteboard (pbcopy)

pbp

Pastes from the pasteboard (pbpaste)

df

Displays free disk space using human readable units

du

Displays disk usage using human readable units

top

Displays information about processes (aliased to htop, if installed)

topc

Displays information about processes sorted by CPU usage (htop not installed)

topm

Displays information about processes sorted by RAM usage (htop not installed)

http-serve

Serves a directory via HTTP

slit

Prints columns 1, 2, 3 ... n

cdls

Changes to a directory and lists its contents

dut

Displays the grand total disk usage using human readable units

find-exec

Finds files and executes a command on them

mkdcd

Makes a directory and changes to it

popdls

Pops an entry off the directory stack and lists its contents

pushdls

Pushes an entry onto the directory stack and lists its contents

diff

Highlights diff output (requires colordiff or Git)

make

Highlights make output (requires colormake)

wdiff

Highlights wdiff output (requires wdiff or Git)

psu

Displays user owned processes status

prep

Provides a grep-like pattern search

psub

Provides a sed-like pattern substitution

Yum

yumc

Removes package(s) and leaves

yumi

Installs package(s)

yumh

Displays history

yuml

Lists packages

yumL

Lists installed packages

yumq

Displays package information

yumr

Removes package(s)

yums

Searches for a package

yumu

Updates packages

yumU

Upgrates packages