├── pages
├── common
│ ├── time.md
│ ├── tty.md
│ ├── chsh.md
│ ├── whoami.md
│ ├── mkfifo.md
│ ├── zless.md
│ ├── jar.md
│ ├── zbarimg.md
│ ├── w3m.md
│ ├── csvlook.md
│ ├── subliminal.md
│ ├── yes.md
│ ├── zcat.md
│ ├── nohup.md
│ ├── visudo.md
│ ├── uptime.md
│ ├── fg.md
│ ├── kill.md
│ ├── pandoc.md
│ ├── id.md
│ ├── git-merge.md
│ ├── git-status.md
│ ├── tldr.md
│ ├── cksum.md
│ ├── date.md
│ ├── echo.md
│ ├── pwd.md
│ ├── salt-run.md
│ ├── phpize.md
│ ├── sleep.md
│ ├── df.md
│ ├── git-init.md
│ ├── readlink.md
│ ├── ebook-convert.md
│ ├── nice.md
│ ├── pdflatex.md
│ ├── sl.md
│ ├── gulp.md
│ ├── mitmproxy.md
│ ├── mkdir.md
│ ├── while.md
│ ├── bg.md
│ ├── csvclean.md
│ ├── vimtutor.md
│ ├── wait.md
│ ├── for.md
│ ├── git-commit.md
│ ├── if.md
│ ├── w.md
│ ├── apropos.md
│ ├── atom.md
│ ├── cmp.md
│ ├── csvpy.md
│ ├── gradle.md
│ ├── seq.md
│ ├── tldrl.md
│ ├── basename.md
│ ├── git-fetch.md
│ ├── ipcs.md
│ ├── tac.md
│ ├── emacs.md
│ ├── node.md
│ ├── git-blame.md
│ ├── rmdir.md
│ ├── host.md
│ ├── git.md
│ ├── ps.md
│ ├── tee.md
│ ├── xcv.md
│ ├── virtualenv.md
│ ├── which.md
│ ├── ab.md
│ ├── git-log.md
│ ├── sh.md
│ ├── su.md
│ ├── deluser.md
│ ├── dhcpwn.md
│ ├── zdb.md
│ ├── java.md
│ ├── arp.md
│ ├── git-checkout.md
│ ├── jobs.md
│ ├── nano.md
│ ├── rustc.md
│ ├── bash.md
│ ├── crontab.md
│ ├── cd.md
│ ├── pushd.md
│ ├── base32.md
│ ├── base64.md
│ ├── git-rm.md
│ ├── mysqldump.md
│ ├── sum.md
│ ├── wc.md
│ ├── apm.md
│ ├── umount.md
│ ├── tail.md
│ ├── bc.md
│ ├── git-svn.md
│ ├── jstack.md
│ ├── shred.md
│ ├── x_x.md
│ ├── gdb.md
│ ├── history.md
│ ├── more.md
│ ├── route.md
│ ├── watch.md
│ ├── git-submodule.md
│ ├── patch.md
│ ├── unzip.md
│ ├── gunzip.md
│ ├── ln.md
│ ├── mtr.md
│ ├── telnet.md
│ ├── cowsay.md
│ ├── pngcrush.md
│ ├── dig.md
│ ├── make.md
│ ├── man.md
│ ├── traceroute.md
│ ├── convmv.md
│ ├── gifsicle.md
│ ├── haxelib.md
│ ├── hn.md
│ ├── hub.md
│ ├── pgrep.md
│ ├── pkill.md
│ ├── sudo.md
│ ├── zsh.md
│ ├── jhat.md
│ ├── lpstat.md
│ ├── python.md
│ ├── rm.md
│ ├── iconv.md
│ ├── git-add.md
│ ├── split.md
│ ├── cat.md
│ ├── git-mv.md
│ ├── vim.md
│ ├── ack.md
│ ├── who.md
│ ├── espeak.md
│ ├── fdupes.md
│ ├── gem.md
│ ├── ioping.md
│ ├── touch.md
│ ├── git-pull.md
│ ├── mitmdump.md
│ ├── alias.md
│ ├── bashmarks.md
│ ├── cal.md
│ ├── passwd.md
│ ├── ping.md
│ ├── sails.md
│ ├── socat.md
│ ├── git-clone.md
│ ├── git-tag.md
│ ├── license.md
│ ├── php.md
│ ├── phpunit.md
│ ├── mp4box.md
│ ├── glances.md
│ ├── salt-key.md
│ ├── git-branch.md
│ ├── salt-call.md
│ ├── strings.md
│ ├── javac.md
│ ├── jmap.md
│ ├── mpc.md
│ ├── mysql.md
│ ├── in2csv.md
│ ├── play.md
│ ├── tmux.md
│ ├── adb.md
│ ├── axel.md
│ ├── bundle.md
│ ├── cloc.md
│ ├── redis-cli.md
│ ├── sort.md
│ ├── unrar.md
│ ├── csvsort.md
│ ├── ghc.md
│ ├── pigz.md
│ ├── salt.md
│ ├── sshfs.md
│ ├── drush.md
│ ├── fswebcam.md
│ ├── mdp.md
│ ├── c99.md
│ ├── file.md
│ ├── nix-env.md
│ ├── tput.md
│ ├── xargs.md
│ ├── fortune.md
│ ├── ifconfig.md
│ ├── git-remote.md
│ ├── optipng.md
│ ├── xz.md
│ ├── git-diff.md
│ ├── chgrp.md
│ ├── csvgrep.md
│ ├── autojump.md
│ ├── diff.md
│ ├── dirs.md
│ ├── dokku.md
│ ├── fsck.md
│ ├── nginx.md
│ ├── odps-func.md
│ ├── test.md
│ ├── mv.md
│ ├── csvcut.md
│ ├── odps-inst.md
│ ├── renice.md
│ ├── vagrant.md
│ ├── ufraw-batch.md
│ ├── git-rebase.md
│ ├── convert.md
│ ├── handbrakecli.md
│ ├── odps-resource.md
│ ├── tree.md
│ ├── pip.md
│ ├── uname.md
│ ├── clang.md
│ ├── env.md
│ ├── ionice.md
│ ├── mocha.md
│ ├── aria2c.md
│ ├── git-push.md
│ ├── pg_dump.md
│ ├── cordova.md
│ ├── ls.md
│ ├── odps-tunnel.md
│ ├── ar.md
│ ├── calibre-server.md
│ ├── chmod.md
│ ├── csvstat.md
│ ├── odps.md
│ ├── svn.md
│ ├── docker.md
│ ├── quota.md
│ ├── skicka.md
│ ├── srm.md
│ ├── zip.md
│ ├── bmaptool.md
│ ├── csvformat.md
│ ├── git-stash.md
│ ├── transcode.md
│ ├── last.md
│ ├── slackcat.md
│ ├── 7za.md
│ ├── sass.md
│ ├── printf.md
│ ├── read.md
│ ├── git-config.md
│ ├── lp.md
│ ├── mount.md
│ ├── calibredb.md
│ ├── enca.md
│ ├── ffmpeg.md
│ ├── mmv.md
│ ├── uniq.md
│ ├── ag.md
│ ├── less.md
│ ├── lsof.md
│ └── cp.md
├── linux
│ ├── userdel.md
│ ├── archey.md
│ ├── pkgrm.md
│ ├── fc-match.md
│ ├── halt.md
│ ├── fc-pattern.md
│ ├── tcpflow.md
│ ├── reboot.md
│ ├── fuser.md
│ ├── mkfs.minix.md
│ ├── ifdown.md
│ ├── ifup.md
│ ├── pkgadd.md
│ ├── chroot.md
│ ├── xclip.md
│ ├── ports.md
│ ├── bzip2.md
│ ├── mkfs.cramfs.md
│ ├── see.md
│ ├── locate.md
│ ├── dpkg.md
│ ├── htop.md
│ ├── pwgen.md
│ ├── systemd-analyze.md
│ ├── edit.md
│ ├── print.md
│ ├── wall.md
│ ├── compose.md
│ ├── chattr.md
│ ├── xinput.md
│ ├── free.md
│ ├── md5sum.md
│ ├── watch.md
│ ├── sha1sum.md
│ ├── usermod.md
│ ├── ssh-copy-id.md
│ ├── mkfs.ntfs.md
│ ├── ulimit.md
│ ├── sha224sum.md
│ ├── sha256sum.md
│ ├── sha384sum.md
│ ├── sha512sum.md
│ ├── mke2fs.md
│ ├── mkfs.exfat.md
│ ├── pkginfo.md
│ ├── nethogs.md
│ ├── nm.md
│ ├── findmnt.md
│ ├── at.md
│ ├── shutdown.md
│ ├── getent.md
│ ├── ufw.md
│ ├── useradd.md
│ ├── dpkg-query.md
│ ├── hwclock.md
│ ├── shuf.md
│ ├── hostname.md
│ ├── screenfetch.md
│ ├── apt-key.md
│ ├── cryptsetup.md
│ ├── zypper.md
│ ├── sysctl.md
│ ├── head.md
│ ├── mkfs.fat.md
│ ├── wpa_cli.md
│ ├── mkfs.vfat.md
│ ├── strace.md
│ ├── ip.md
│ ├── notify-send.md
│ ├── ltrace.md
│ ├── lsblk.md
│ ├── pkgmk.md
│ ├── jobs.md
│ ├── sort.md
│ ├── expand.md
│ ├── timedatectl.md
│ ├── lsb_release.md
│ ├── apt-cache.md
│ ├── equery.md
│ ├── lsattr.md
│ ├── dnf.md
│ ├── top.md
│ ├── unexpand.md
│ ├── journalctl.md
│ ├── rpm.md
│ ├── umask.md
│ ├── netstat.md
│ ├── du.md
│ ├── systemctl.md
│ ├── yaourt.md
│ ├── yum.md
│ ├── prt-get.md
│ └── apt-get.md
├── osx
│ ├── hostname.md
│ ├── sw_vers.md
│ ├── look.md
│ ├── head.md
│ ├── caffeinate.md
│ ├── pbcopy.md
│ ├── drutil.md
│ ├── pbpaste.md
│ ├── xed.md
│ ├── mdfind.md
│ ├── shutdown.md
│ ├── nm.md
│ ├── locate.md
│ ├── qlmanage.md
│ ├── base64.md
│ ├── w.md
│ ├── airport.md
│ ├── md5.md
│ ├── xsltproc.md
│ ├── archey.md
│ ├── diskutil.md
│ ├── netstat.md
│ ├── ditto.md
│ ├── system_profiler.md
│ ├── xctool.md
│ ├── sysctl.md
│ ├── du.md
│ ├── open.md
│ ├── say.md
│ ├── brew.md
│ ├── top.md
│ ├── wacaw.md
│ ├── xattr.md
│ ├── dd.md
│ ├── networksetup.md
│ └── route.md
└── sunos
│ ├── devfsadm.md
│ ├── svccfg.md
│ ├── prctl.md
│ ├── svcs.md
│ ├── prstat.md
│ └── svcadm.md
├── commandList.hbs
├── package.json
└── .gitignore
/pages/common/time.md:
--------------------------------------------------------------------------------
1 | # time
2 |
3 | > See how long a command takes.
4 |
5 | - Time "ls":
6 |
7 | `time ls`
8 |
--------------------------------------------------------------------------------
/pages/common/tty.md:
--------------------------------------------------------------------------------
1 | # tty
2 |
3 | > Returns terminal name.
4 |
5 | - Print the file name of this terminal:
6 |
7 | `tty`
8 |
--------------------------------------------------------------------------------
/pages/linux/userdel.md:
--------------------------------------------------------------------------------
1 | # userdel
2 |
3 | > Remove a user.
4 |
5 | - Remove a user and their home directory:
6 |
7 | `userdel -r {{name}}`
8 |
--------------------------------------------------------------------------------
/pages/common/chsh.md:
--------------------------------------------------------------------------------
1 | # chsh
2 |
3 | > Change user's login shell.
4 |
5 | - Change shell:
6 |
7 | `chsh -s {{path/to/shell_binary}} {{username}}`
8 |
--------------------------------------------------------------------------------
/pages/common/whoami.md:
--------------------------------------------------------------------------------
1 | # whoami
2 |
3 | > Show the username of the current user.
4 |
5 | - Display currently logged user name:
6 |
7 | `whoami`
8 |
--------------------------------------------------------------------------------
/pages/common/mkfifo.md:
--------------------------------------------------------------------------------
1 | # mkfifo
2 |
3 | > Makes FIFOs (named pipes).
4 |
5 | - Create a named pipe at a given path:
6 |
7 | `mkfifo {{path/to/pipe}}`
8 |
--------------------------------------------------------------------------------
/pages/common/zless.md:
--------------------------------------------------------------------------------
1 | # zless
2 |
3 | > View compressed files.
4 |
5 | - Page through a compressed archive with `less`:
6 |
7 | `zless {{file.txt.gz}}`
8 |
--------------------------------------------------------------------------------
/pages/linux/archey.md:
--------------------------------------------------------------------------------
1 | # archey
2 |
3 | > Simple tool for stylishly displaying system information.
4 |
5 | - Show system information:
6 |
7 | `archey`
8 |
--------------------------------------------------------------------------------
/pages/linux/pkgrm.md:
--------------------------------------------------------------------------------
1 | # pkgrm
2 |
3 | > Remove a package from a CRUX system.
4 |
5 | - Remove an installed package:
6 |
7 | `pkgrm {{package-name}}`
8 |
--------------------------------------------------------------------------------
/pages/common/jar.md:
--------------------------------------------------------------------------------
1 | # jar
2 |
3 | > Java Applications/Libraries Packager.
4 |
5 | - Unzip .jar/.war file to the current directory:
6 |
7 | `jar -xvf *.jar`
8 |
--------------------------------------------------------------------------------
/pages/common/zbarimg.md:
--------------------------------------------------------------------------------
1 | # zbarimg
2 |
3 | > Scan and decode bar codes from image file(s).
4 |
5 | - Process an image file:
6 |
7 | `zbarimg {{image file}}`
8 |
--------------------------------------------------------------------------------
/pages/linux/fc-match.md:
--------------------------------------------------------------------------------
1 | # fc-match
2 |
3 | > Match available fonts.
4 |
5 | - Return a sorted list of best matching fonts:
6 |
7 | `fc-match -s '{{Font Name}}'`
8 |
--------------------------------------------------------------------------------
/commandList.hbs:
--------------------------------------------------------------------------------
1 |
2 | {{#each commands}}
3 | - {{name}}
4 | {{/each}}
5 |
--------------------------------------------------------------------------------
/pages/common/w3m.md:
--------------------------------------------------------------------------------
1 | # w3m
2 |
3 | > A text-based web browser.
4 |
5 | - Open an URL:
6 |
7 | `w3m {{http://example.com}}`
8 |
9 | - Quit w3m:
10 |
11 | `'q' then 'y'`
12 |
--------------------------------------------------------------------------------
/pages/common/csvlook.md:
--------------------------------------------------------------------------------
1 | # csvlook
2 |
3 | > Render a CSV file in the console as a fixed-width table.
4 | > Included in csvkit.
5 |
6 | - View a CSV file:
7 |
8 | `csvlook {{data.csv}}`
9 |
--------------------------------------------------------------------------------
/pages/linux/halt.md:
--------------------------------------------------------------------------------
1 | # halt
2 |
3 | > Power off or reboot the machine.
4 |
5 | - Power the machine off:
6 |
7 | `halt`
8 |
9 | - Reboot the machine:
10 |
11 | `halt --reboot`
12 |
--------------------------------------------------------------------------------
/pages/common/subliminal.md:
--------------------------------------------------------------------------------
1 | # subliminal
2 |
3 | > Python-based subtitle downloader.
4 |
5 | - Download English subtitles for a video:
6 |
7 | `subliminal download -l {{en}} {{video.ext}}`
8 |
--------------------------------------------------------------------------------
/pages/common/yes.md:
--------------------------------------------------------------------------------
1 | # yes
2 |
3 | > Output something repeatedly.
4 |
5 | - Repeatedly output "message":
6 |
7 | `yes {{message}}`
8 |
9 | - Repeatedly output "y":
10 |
11 | `yes`
12 |
--------------------------------------------------------------------------------
/pages/common/zcat.md:
--------------------------------------------------------------------------------
1 | # zcat
2 |
3 | > Print data from gzip compressed files.
4 |
5 | - Print the uncompressed contents of a gzipped file to the standard output:
6 |
7 | `zcat {{file.txt.gz}}`
8 |
--------------------------------------------------------------------------------
/pages/linux/fc-pattern.md:
--------------------------------------------------------------------------------
1 | # fc-pattern
2 |
3 | > Shows information about a font matching a pattern.
4 |
5 | - Display default infomation about a font:
6 |
7 | `fc-pattern -d '{{Font Name}}'`
8 |
--------------------------------------------------------------------------------
/pages/common/nohup.md:
--------------------------------------------------------------------------------
1 | # nohup
2 |
3 | > Allows for a process to live when the terminal gets killed.
4 |
5 | - Run process that can live beyond the terminal:
6 |
7 | `nohup {{command options}}`
8 |
--------------------------------------------------------------------------------
/pages/linux/tcpflow.md:
--------------------------------------------------------------------------------
1 | # tcpflow
2 |
3 | > Capture TCP traffic for debugging and analysis.
4 |
5 | - Show all data on the given interface and port:
6 |
7 | `tcpflow -c -i {{eth0}} port {{80}}`
8 |
--------------------------------------------------------------------------------
/pages/linux/reboot.md:
--------------------------------------------------------------------------------
1 | # reboot
2 |
3 | > Reboot the system.
4 |
5 | - Reboot immediately:
6 |
7 | `reboot`
8 |
9 | - Reboot immediately without gracefully shutdown:
10 |
11 | `reboot -f`
12 |
--------------------------------------------------------------------------------
/pages/common/visudo.md:
--------------------------------------------------------------------------------
1 | # visudo
2 |
3 | > Safely edit the sudoers file.
4 |
5 | - Edit sudoers file:
6 |
7 | `sudo visudo`
8 |
9 | - Check sudoers file for errors:
10 |
11 | `sudo visudo -c`
12 |
--------------------------------------------------------------------------------
/pages/linux/fuser.md:
--------------------------------------------------------------------------------
1 | # fuser
2 |
3 | > Display process IDs currently using files or sockets.
4 | > Require admin privileges.
5 |
6 | - Identify process using a TCP socket:
7 |
8 | `fuser -n tcp {{port}}`
9 |
--------------------------------------------------------------------------------
/pages/common/uptime.md:
--------------------------------------------------------------------------------
1 | # uptime
2 |
3 | > Tell how long the system has been running and other information.
4 |
5 | - Print current time, uptime, number of logged-in users and other information:
6 |
7 | `uptime`
8 |
--------------------------------------------------------------------------------
/pages/linux/mkfs.minix.md:
--------------------------------------------------------------------------------
1 | # mkfs.minix
2 |
3 | > Creates a Minix filesystem inside a partition.
4 |
5 | - Create a Minix filesystem inside partition 1 on device b (`sdb1`):
6 |
7 | `mkfs.minix {{/dev/sdb1}}`
8 |
--------------------------------------------------------------------------------
/pages/linux/ifdown.md:
--------------------------------------------------------------------------------
1 | # ifdown
2 |
3 | > Disable network interfaces.
4 |
5 | - Disable interface eth0:
6 |
7 | `ifdown {{eth0}}`
8 |
9 | - Disable all interfaces which are enabled:
10 |
11 | `ifdown -a`
12 |
--------------------------------------------------------------------------------
/pages/osx/hostname.md:
--------------------------------------------------------------------------------
1 | # hostname
2 |
3 | > Show or set the system's host name.
4 |
5 | - Show current host name:
6 |
7 | `hostname`
8 |
9 | - Set current host name:
10 |
11 | `hostname {{new_hostname}}`
12 |
--------------------------------------------------------------------------------
/pages/common/fg.md:
--------------------------------------------------------------------------------
1 | # fg
2 |
3 | > Run jobs in foreground.
4 |
5 | - Bring most recently suspended background job to foreground:
6 |
7 | `fg`
8 |
9 | - Bring a specific job to foreground:
10 |
11 | `fg {{job_id}}`
12 |
--------------------------------------------------------------------------------
/pages/osx/sw_vers.md:
--------------------------------------------------------------------------------
1 | # sw_vers
2 |
3 | > Print Mac OSX Software versioning information.
4 |
5 | - Print OSX Version:
6 |
7 | `sw_vers -productVersion`
8 |
9 | - Print OSX Build:
10 |
11 | `sw_vers -buildVersion`
12 |
--------------------------------------------------------------------------------
/pages/common/kill.md:
--------------------------------------------------------------------------------
1 | # kill
2 |
3 | > Sends a signal to a process.
4 | > Mostly used for stopping processes.
5 |
6 | - Kill the process:
7 |
8 | `kill {{process_id}}`
9 |
10 | - List signal names:
11 |
12 | `kill -l`
13 |
--------------------------------------------------------------------------------
/pages/common/pandoc.md:
--------------------------------------------------------------------------------
1 | # pandoc
2 |
3 | > General markup converter.
4 |
5 | - Convert file to pdf (the output format is automatically determined from the output file's extension):
6 |
7 | `pandoc {{input.md}} -o {{output.pdf}}`
8 |
--------------------------------------------------------------------------------
/pages/common/id.md:
--------------------------------------------------------------------------------
1 | # id
2 |
3 | > Display current user and group identity.
4 |
5 | - Display the current user identity as a number:
6 |
7 | `id -u`
8 |
9 | - Display the current group identity as a number:
10 |
11 | `id -g`
12 |
--------------------------------------------------------------------------------
/pages/common/git-merge.md:
--------------------------------------------------------------------------------
1 | # git merge
2 |
3 | > Merge branches.
4 |
5 | - Merge a branch with your current branch:
6 |
7 | `git merge {{BRANCH-NAME}}`
8 |
9 | - Edit the merge message:
10 |
11 | `git merge -e {{BRANCH-NAME}}`
12 |
--------------------------------------------------------------------------------
/pages/common/git-status.md:
--------------------------------------------------------------------------------
1 | # git status
2 |
3 | > Show the index (changed files).
4 |
5 | - Show changed files which are not yet added for commit:
6 |
7 | `git status`
8 |
9 | - Give output in short format:
10 |
11 | `git status -s`
12 |
--------------------------------------------------------------------------------
/pages/common/tldr.md:
--------------------------------------------------------------------------------
1 | # tldr
2 |
3 | > Simplified man pages.
4 |
5 | - Get typical usages of a command (hint: this is how you got here!):
6 |
7 | `tldr {{command}}`
8 |
9 | - Update the local cache of tldr pages:
10 |
11 | `tldr --update`
12 |
--------------------------------------------------------------------------------
/pages/linux/ifup.md:
--------------------------------------------------------------------------------
1 | # ifup
2 |
3 | > Tool used to enable network interfaces.
4 |
5 | - Enable interface eth0:
6 |
7 | `ifup {{eth0}}`
8 |
9 | - Enable all the interfaces defined with "auto" in /etc/network/interfaces:
10 |
11 | `ifup -a`
12 |
--------------------------------------------------------------------------------
/pages/common/cksum.md:
--------------------------------------------------------------------------------
1 | # cksum
2 |
3 | > Calculates CRC checksums and byte counts of a file.
4 | > Note, on old UNIX systems the CRC implementation may differ.
5 |
6 | - Display a 32 bit checksum, size in bytes and filename:
7 |
8 | `cksum {{filename}}`
9 |
--------------------------------------------------------------------------------
/pages/common/date.md:
--------------------------------------------------------------------------------
1 | # date
2 |
3 | > Set or display the system date.
4 |
5 | - Display the date using the default locale:
6 |
7 | `date +"%c"`
8 |
9 | - Display the date in UTC and ISO 8601 format:
10 |
11 | `date -u +"%Y-%m-%dT%H:%M:%SZ"`
12 |
--------------------------------------------------------------------------------
/pages/osx/look.md:
--------------------------------------------------------------------------------
1 | # look
2 |
3 | > Look for lines in sorted file.
4 |
5 | - Look for lines which begins with the given prefix:
6 |
7 | `look {{prefix}} {{file}}`
8 |
9 | - Look for lines ignoring case:
10 |
11 | `look -f {{prefix}} {{file}}`
12 |
--------------------------------------------------------------------------------
/pages/common/echo.md:
--------------------------------------------------------------------------------
1 | # echo
2 |
3 | > Print given arguments.
4 |
5 | - Print a text message. Note: quotes are optional:
6 |
7 | `echo {{"Hello World"}}`
8 |
9 | - Print a message with environment variables:
10 |
11 | `echo {{"My path is $PATH"}}`
12 |
--------------------------------------------------------------------------------
/pages/common/pwd.md:
--------------------------------------------------------------------------------
1 | # pwd
2 |
3 | > Print name of current/working directory.
4 |
5 | - Print the current directory:
6 |
7 | `pwd`
8 |
9 | - Print the current directory, and resolve all symlinks (i.e. show the "physical" path):
10 |
11 | `pwd -P`
12 |
--------------------------------------------------------------------------------
/pages/common/salt-run.md:
--------------------------------------------------------------------------------
1 | # salt-run
2 |
3 | > Frontend for executing salt-runners on minions.
4 |
5 | - Show status of all minions:
6 |
7 | `salt-run manage.status`
8 |
9 | - Show all minions which are disconnected:
10 |
11 | `salt-run manage.up`
12 |
--------------------------------------------------------------------------------
/pages/common/phpize.md:
--------------------------------------------------------------------------------
1 | # phpize
2 |
3 | > Prepare a PHP extension for compiling.
4 |
5 | - Prepare the PHP extension in the current directory for compiling:
6 |
7 | `phpize`
8 |
9 | - Delete files previously created by phpize:
10 |
11 | `phpize --clean`
12 |
--------------------------------------------------------------------------------
/pages/common/sleep.md:
--------------------------------------------------------------------------------
1 | # sleep
2 |
3 | > Delay for a specified amount of time.
4 |
5 | - Delay in seconds:
6 |
7 | `sleep {{seconds}}`
8 |
9 | - Delay in minutes:
10 |
11 | `sleep {{minutes}}m`
12 |
13 | - Delay in hours:
14 |
15 | `sleep {{hours}}h`
16 |
--------------------------------------------------------------------------------
/pages/common/df.md:
--------------------------------------------------------------------------------
1 | # df
2 |
3 | > Gives an overview of the file system disk space usage.
4 |
5 | - Display all file systems and their disk usage:
6 |
7 | `df`
8 |
9 | - Display all file systems and their disk usage in human readable form:
10 |
11 | `df -h`
12 |
--------------------------------------------------------------------------------
/pages/linux/pkgadd.md:
--------------------------------------------------------------------------------
1 | # pkgadd
2 |
3 | > Add a package to a CRUX system.
4 |
5 | - Install a local software package:
6 |
7 | `pkgadd {{package-name}}`
8 |
9 | - Update an already installed package from a local package:
10 |
11 | `pkgadd -u {{package-name}}`
12 |
--------------------------------------------------------------------------------
/pages/common/git-init.md:
--------------------------------------------------------------------------------
1 | # git init
2 |
3 | > Initializes a new local Git repository.
4 |
5 | - Initialize a new local repository:
6 |
7 | `git init`
8 |
9 | - Initialize a barebones repository, suitable for use as a remote over ssh:
10 |
11 | `git init --bare`
12 |
--------------------------------------------------------------------------------
/pages/common/readlink.md:
--------------------------------------------------------------------------------
1 | # readlink
2 |
3 | > Follow symlinks and get symlink information.
4 |
5 | - Get the actual file to which the symlink points:
6 |
7 | `readlink {{filename}}`
8 |
9 | - Get the absolute path to a file:
10 |
11 | `readlink -f {{filename}}`
12 |
--------------------------------------------------------------------------------
/pages/common/ebook-convert.md:
--------------------------------------------------------------------------------
1 | # ebook-convert
2 |
3 | > Can be used to convert ebooks between common formats, e.g., pdf, epub and mobi.
4 | > Part of the Calibre ebook library tool.
5 |
6 | - Convert an ebook into another format:
7 |
8 | `ebook-convert {{source}} {{destination}}`
9 |
--------------------------------------------------------------------------------
/pages/common/nice.md:
--------------------------------------------------------------------------------
1 | # nice
2 |
3 | > Execute a program with a custom scheduling priority (niceness).
4 | > Niceness values range from -20 (the highest priority) to 19 (the lowest).
5 |
6 | - Launch a program with altered priority:
7 |
8 | `nice -n {{niceness_value}} {{command}}`
9 |
--------------------------------------------------------------------------------
/pages/common/pdflatex.md:
--------------------------------------------------------------------------------
1 | # pdflatex
2 |
3 | > Compile a pdf document from LaTeX source files.
4 |
5 | - Compile a pdf document:
6 |
7 | `pdflatex {{source.tex}}`
8 |
9 | - Compile a pdf document, halting on each error:
10 |
11 | `pdflatex -halt-on-error {{source.tex}}`
12 |
--------------------------------------------------------------------------------
/pages/common/sl.md:
--------------------------------------------------------------------------------
1 | # sl
2 |
3 | > Steam locomotive running through your terminal.
4 |
5 | - Let a steam locomotive run through your terminal:
6 |
7 | `sl`
8 |
9 | - The train burns, people scream:
10 |
11 | `sl -a`
12 |
13 | - Let the train fly:
14 |
15 | `sl -F`
16 |
--------------------------------------------------------------------------------
/pages/osx/head.md:
--------------------------------------------------------------------------------
1 | # head
2 |
3 | > Output the first part of files.
4 |
5 | - Output the first few lines of a file:
6 |
7 | `head -n {{count_of_lines}} {{filename}}`
8 |
9 | - Output the first few bytes of a file:
10 |
11 | `head -c {{number_in_bytes}} {{filename}}`
12 |
--------------------------------------------------------------------------------
/pages/common/gulp.md:
--------------------------------------------------------------------------------
1 | # gulp
2 |
3 | > JavaScript task runner and streaming build system.
4 | > Tasks are defined within gulpfile.js at the project root.
5 |
6 | - Run the default task:
7 |
8 | `gulp`
9 |
10 | - Run individual tasks:
11 |
12 | `gulp {{task}} {{othertask}}`
13 |
--------------------------------------------------------------------------------
/pages/common/mitmproxy.md:
--------------------------------------------------------------------------------
1 | # mitmproxy
2 |
3 | > An interactive man-in-the-middle HTTP proxy.
4 |
5 | - Start mitmproxy with default settings:
6 |
7 | `mitmproxy`
8 |
9 | - Start mitmproxy bound to custom address and port:
10 |
11 | `mitmproxy -b {{ip_address}} -p {{port}}`
12 |
--------------------------------------------------------------------------------
/pages/common/mkdir.md:
--------------------------------------------------------------------------------
1 | # mkdir
2 |
3 | > Creates a directory.
4 |
5 | - Create a directory in current folder or given path:
6 |
7 | `mkdir {{directory}}`
8 |
9 | - Create directories recursively (useful for creating nested dirs):
10 |
11 | `mkdir -p {{path/to/directory}}`
12 |
--------------------------------------------------------------------------------
/pages/common/while.md:
--------------------------------------------------------------------------------
1 | # while
2 |
3 | > Simple shell loop.
4 |
5 | - Read stdin and perform an action on every line:
6 |
7 | `while read line; do echo "$line"; done`
8 |
9 | - Execute a command forever once every second:
10 |
11 | `while :; do {{command}}; sleep 1; done`
12 |
--------------------------------------------------------------------------------
/pages/osx/caffeinate.md:
--------------------------------------------------------------------------------
1 | # caffeinate
2 |
3 | > Prevent a system from sleeping.
4 |
5 | - Prevent mac from sleeping for 1 hour (3600 seconds):
6 |
7 | `caffeinate -u -t 3600`
8 |
9 | - Prevent mac from sleeping until a command completes:
10 |
11 | `caffeinate -s {{command}}`
12 |
--------------------------------------------------------------------------------
/pages/osx/pbcopy.md:
--------------------------------------------------------------------------------
1 | # pbcopy
2 |
3 | > Place standard output in the clipboard.
4 |
5 | - Place the contents of a file in the clipboard:
6 |
7 | `pbcopy < {{file}}`
8 |
9 | - Place the results of a command in the clipboard:
10 |
11 | `find . -type t -name "*.png" | pbcopy`
12 |
--------------------------------------------------------------------------------
/pages/common/bg.md:
--------------------------------------------------------------------------------
1 | # bg
2 |
3 | > Resumes suspended jobs and keeps them running in the background.
4 |
5 | - Resume most recently suspended background job running in the background:
6 |
7 | `bg`
8 |
9 | - Resume a specific job running in the background:
10 |
11 | `bg {{job_id}}`
12 |
--------------------------------------------------------------------------------
/pages/common/csvclean.md:
--------------------------------------------------------------------------------
1 | # csvclean
2 |
3 | > Finds and cleans common syntax errors in CSV files.
4 | > Included in csvkit.
5 |
6 | - Clean a CSV file:
7 |
8 | `csvclean {{bad.csv}}`
9 |
10 | - List locations of syntax errors in a CSV file:
11 |
12 | `csvclean -n {{bad.csv}}`
13 |
--------------------------------------------------------------------------------
/pages/common/vimtutor.md:
--------------------------------------------------------------------------------
1 | # vimtutor
2 |
3 | > Vim tutor, teaching the basic vim commands.
4 |
5 | - Launch the vim tutor using the given language (en, fr, de, ...):
6 |
7 | `vimtutor {{language}}`
8 |
9 | - Exit the tutor:
10 |
11 | `[Esc] (to switch to normal mode), then :q`
12 |
--------------------------------------------------------------------------------
/pages/common/wait.md:
--------------------------------------------------------------------------------
1 | # wait
2 |
3 | > Wait for a process to complete before proceeding.
4 |
5 | - Wait for given process id (pid) to finish and return its exit status:
6 |
7 | `wait {{pid}}`
8 |
9 | - Wait for all processes known to the invoking shell to finish:
10 |
11 | `wait`
12 |
--------------------------------------------------------------------------------
/pages/osx/drutil.md:
--------------------------------------------------------------------------------
1 | # drutil
2 |
3 | > Interact with DVD burners.
4 |
5 | - Eject a disk from the drive:
6 |
7 | `drutil eject`
8 |
9 | - Burn a folder as an ISO9660 filesystem onto a DVD. Don't verify and eject when complete:
10 |
11 | `drutil burn -noverify -eject -iso9660`
12 |
--------------------------------------------------------------------------------
/pages/osx/pbpaste.md:
--------------------------------------------------------------------------------
1 | # pbpaste
2 |
3 | > Send the contents of the clipboard to standard output.
4 |
5 | - Write the contents of the clipboard to a file:
6 |
7 | `pbpaste > {{file}}`
8 |
9 | - Use the contents of the clipboard as input to a command:
10 |
11 | `pbpaste | grep foo`
12 |
--------------------------------------------------------------------------------
/pages/common/for.md:
--------------------------------------------------------------------------------
1 | # for
2 |
3 | > Shell loop over parameters.
4 |
5 | - Perform a command with different arguments:
6 |
7 | `for argument in 1 2 3; do {{command $argument}}; done`
8 |
9 | - Perform a command in every directory:
10 |
11 | `for d in *; do (cd $d; {{command}}); done`
12 |
--------------------------------------------------------------------------------
/pages/common/git-commit.md:
--------------------------------------------------------------------------------
1 | # git commit
2 |
3 | > Commit staged files to the repository.
4 |
5 | - Commit staged files to the repository with comment:
6 |
7 | `git commit -m {{MESSAGE}}`
8 |
9 | - Replace the last commit with currently staged changes:
10 |
11 | `git commit --amend`
12 |
--------------------------------------------------------------------------------
/pages/common/if.md:
--------------------------------------------------------------------------------
1 | # if
2 |
3 | > Simple shell conditional.
4 |
5 | - Echo a different thing depending on a command's success:
6 |
7 | `{{command}} && echo "success" || echo "failure"`
8 |
9 | - Full if syntax:
10 |
11 | `if {{condition}}; then echo "true"; else echo "false"; fi`
12 |
--------------------------------------------------------------------------------
/pages/common/w.md:
--------------------------------------------------------------------------------
1 | # w
2 |
3 | > Show who is logged on and what they are doing.
4 | > Print user login, TTY, remote host, login time, idle time, current process.
5 |
6 | - Show logged-in users info:
7 |
8 | `w`
9 |
10 | - Show logged-in users info without a header:
11 |
12 | `w -h`
13 |
--------------------------------------------------------------------------------
/pages/common/apropos.md:
--------------------------------------------------------------------------------
1 | # apropos
2 |
3 | > Search in manpages.
4 | > For example to find a new command.
5 |
6 | - Search for keyword:
7 |
8 | `apropos {{regular_expression}}`
9 |
10 | - Search without restricting output to terminal width:
11 |
12 | `apropos -l {{regular_expression}}`
13 |
--------------------------------------------------------------------------------
/pages/common/atom.md:
--------------------------------------------------------------------------------
1 | # atom
2 |
3 | > A cross-platform pluggable text editor.
4 | > Plugins are managed by `apm`.
5 |
6 | - Open a file or folder:
7 |
8 | `atom {{path/to/file/or/folder}}`
9 |
10 | - Open a file or folder in a new window:
11 |
12 | `atom -n {{path/to/file/or/folder}}`
13 |
--------------------------------------------------------------------------------
/pages/common/cmp.md:
--------------------------------------------------------------------------------
1 | # cmp
2 |
3 | > Compare two files.
4 |
5 | - Find the byte number and line number of the first difference between the files:
6 |
7 | `cmp {{file1}} {{file2}}`
8 |
9 | - Find the byte number and differing bytes of every difference:
10 |
11 | `cmp -l {{file1}} {{file2}}`
12 |
--------------------------------------------------------------------------------
/pages/common/csvpy.md:
--------------------------------------------------------------------------------
1 | # csvpy
2 |
3 | > Loads a CSV file into a Python shell.
4 | > Included in csvkit.
5 |
6 | - Load a CSV file into a `CSVKitReader` object:
7 |
8 | `csvpy {{data.csv}}`
9 |
10 | - Load a CSV file into a `CSVKitDictReader` object:
11 |
12 | `csvpy --dict {{data.csv}}`
13 |
--------------------------------------------------------------------------------
/pages/common/gradle.md:
--------------------------------------------------------------------------------
1 | # Gradle
2 |
3 | > Gradle is the official build system for Android Studio.
4 |
5 | - Compile a package:
6 |
7 | `gradle build`
8 |
9 | - Clear the build folder:
10 |
11 | `gradle clean`
12 |
13 | - Compile and Release package:
14 |
15 | `gradle assembleRelease`
16 |
--------------------------------------------------------------------------------
/pages/common/seq.md:
--------------------------------------------------------------------------------
1 | # seq
2 |
3 | > Output a sequence of numbers to stdout.
4 |
5 | - Sequence from 1 to 10:
6 |
7 | `seq 10`
8 |
9 | - Every 3rd number from 5 to 20:
10 |
11 | `seq 5 3 20`
12 |
13 | - Separate the output with a space instead of a newline:
14 |
15 | `seq -s " " 5 3 20`
16 |
--------------------------------------------------------------------------------
/pages/common/tldrl.md:
--------------------------------------------------------------------------------
1 | # tldrl
2 |
3 | > Lint and format TLDR pages.
4 |
5 | - Lint all pages:
6 |
7 | `tldrl {{pages_directory}}`
8 |
9 | - Format a specific page to stdout:
10 |
11 | `tldrl -f {{page.md}}`
12 |
13 | - Format all pages in place:
14 |
15 | `tldrl -fi {{pages_directory}}`
16 |
--------------------------------------------------------------------------------
/pages/common/basename.md:
--------------------------------------------------------------------------------
1 | # basename
2 |
3 | > Returns non-directory portion of a pathname.
4 |
5 | - Show only the file name from a path:
6 |
7 | `basename {{path/to/file}}`
8 |
9 | - Show only the file name from a path, with a suffix removed:
10 |
11 | `basename {{path/to/file}} {{suffix}}`
12 |
--------------------------------------------------------------------------------
/pages/common/git-fetch.md:
--------------------------------------------------------------------------------
1 | # git fetch
2 |
3 | > Download objects and refs from a remote repository.
4 |
5 | - Fetch new branches and update remote-tracking branches:
6 |
7 | `git fetch {{remote_name}}`
8 |
9 | - Fetch the latest changes from all remote git servers:
10 |
11 | `git fetch --all`
12 |
--------------------------------------------------------------------------------
/pages/common/ipcs.md:
--------------------------------------------------------------------------------
1 | # ipcs
2 |
3 | > Display information about ressources used in IPC (Inter-process Communication).
4 |
5 | - Specific information about the Message Queue which has the id 32768:
6 |
7 | `ipcs -qi 32768`
8 |
9 | - General information about all the IPC:
10 |
11 | `ipcs -a`
12 |
--------------------------------------------------------------------------------
/pages/common/tac.md:
--------------------------------------------------------------------------------
1 | # tac
2 |
3 | > Print and concatenate files in reverse.
4 |
5 | - Print the contents of *file1* reversed to the standard output:
6 |
7 | `tac {{file1}}`
8 |
9 | - Concatenate several files reversed into the target file:
10 |
11 | `tac {{file1}} {{file2}} > {{target-file}}`
12 |
--------------------------------------------------------------------------------
/pages/common/emacs.md:
--------------------------------------------------------------------------------
1 | # emacs
2 |
3 | > The extensible, customizable, self-documenting, real-time display editor.
4 |
5 | - Open emacs in console mode (without X window):
6 |
7 | `emacs -nw`
8 |
9 | - Open a file in emacs:
10 |
11 | `emacs {{filename}}`
12 |
13 | - Exit emacs:
14 |
15 | `C-x C-c`
16 |
--------------------------------------------------------------------------------
/pages/common/node.md:
--------------------------------------------------------------------------------
1 | # node
2 |
3 | > Server-side JavaScript platform (Node.js).
4 |
5 | - Run a JavaScript file:
6 |
7 | `node {{file}}.js`
8 |
9 | - Start a REPL (interactive shell):
10 |
11 | `node`
12 |
13 | - Evaluate JavaScript by passing it in the command:
14 |
15 | `node -e "{{code}}"`
16 |
--------------------------------------------------------------------------------
/pages/linux/chroot.md:
--------------------------------------------------------------------------------
1 | # chroot
2 |
3 | > Run command or interactive shell with special root directory.
4 |
5 | - Run command as new root directory:
6 |
7 | `chroot {{/path/to/new/root}} {{command}}`
8 |
9 | - Specify user and group (ID or name) to use:
10 |
11 | `chroot --userspec={{user:group}}`
12 |
--------------------------------------------------------------------------------
/pages/common/git-blame.md:
--------------------------------------------------------------------------------
1 | # git blame
2 |
3 | > Show commit hash and last author on each line of a file.
4 |
5 | - Print file with author name and commit hash on each line:
6 |
7 | `git blame {{file}}`
8 |
9 | - Print file with author email and commit hash on each line:
10 |
11 | `git blame -e {{file}}`
12 |
--------------------------------------------------------------------------------
/pages/common/rmdir.md:
--------------------------------------------------------------------------------
1 | # rmdir
2 |
3 | > Removes a directory.
4 |
5 | - Remove directory, provided it is empty. Use `rm` to remove not empty directories:
6 |
7 | `rmdir {{path/to/directory}}`
8 |
9 | - Remove directories recursively (useful for nested dirs):
10 |
11 | `rmdir -p {{path/to/directory}}`
12 |
--------------------------------------------------------------------------------
/pages/linux/xclip.md:
--------------------------------------------------------------------------------
1 | # xclip
2 |
3 | > Copy STDIN to clipboard or print clipboard to STDOUT.
4 |
5 | - Copy output to clipboard:
6 |
7 | `echo 123 | xclip -i`
8 |
9 | - Copy output to system clipboard:
10 |
11 | `echo 123 | xclip -sel clip`
12 |
13 | - Paste clipboard:
14 |
15 | `xclip -o > file.txt`
16 |
--------------------------------------------------------------------------------
/pages/common/host.md:
--------------------------------------------------------------------------------
1 | # host
2 |
3 | > Lookup Domain Name Server.
4 |
5 | - Lookup A, AAAA, and MX records of a domain:
6 |
7 | `host {{domain}}`
8 |
9 | - Lookup a field (CNAME, TXT,...) of a domain:
10 |
11 | `host -t {{field}} {{domain}}`
12 |
13 | - Reverse lookup an IP:
14 |
15 | `host {{ip_address}}`
16 |
--------------------------------------------------------------------------------
/pages/linux/ports.md:
--------------------------------------------------------------------------------
1 | # ports
2 |
3 | > Update/list the ports tree on a CRUX system.
4 |
5 | - Update the ports tree:
6 |
7 | `ports -u`
8 |
9 | - List the ports in the current tree:
10 |
11 | `ports -l`
12 |
13 | - Check the differences between installed packages and the ports tree:
14 |
15 | `ports -d`
16 |
--------------------------------------------------------------------------------
/pages/common/git.md:
--------------------------------------------------------------------------------
1 | # git
2 |
3 | > Main command for all git commands.
4 |
5 | - Check the Git version:
6 |
7 | `git --version`
8 |
9 | - Call general help:
10 |
11 | `git --help`
12 |
13 | - Call help on a command:
14 |
15 | `git help {{COMMAND}}`
16 |
17 | - Execute Git command:
18 |
19 | `git {{COMMAND}}`
20 |
--------------------------------------------------------------------------------
/pages/common/ps.md:
--------------------------------------------------------------------------------
1 | # ps
2 |
3 | > Information about running processes.
4 |
5 | - List all running processes:
6 |
7 | `ps aux`
8 |
9 | - List all running processes including the full command string:
10 |
11 | `ps auxww`
12 |
13 | - Search for a process that matches a string:
14 |
15 | `ps aux | grep {{string}}`
16 |
--------------------------------------------------------------------------------
/pages/common/tee.md:
--------------------------------------------------------------------------------
1 | # tee
2 |
3 | > Read from standard input and write to standard output and files.
4 |
5 | - Copy standard input to each FILE, and also to standard output:
6 |
7 | `echo "example" | tee {{FILE}}`
8 |
9 | - Append to the given FILEs, do not overwrite:
10 |
11 | `echo "example" | tee -a {{FILE}}`
12 |
--------------------------------------------------------------------------------
/pages/common/xcv.md:
--------------------------------------------------------------------------------
1 | # xcv
2 |
3 | > Cut, copy, and paste in the command-line.
4 |
5 | - Cut a file:
6 |
7 | `xcv x {{input_file}}`
8 |
9 | - Copy a file:
10 |
11 | `xcv c {{input_file}}`
12 |
13 | - Paste a file:
14 |
15 | `xcv v {{output_file}}`
16 |
17 | - List files available for pasting:
18 |
19 | `xcv l`
20 |
--------------------------------------------------------------------------------
/pages/linux/bzip2.md:
--------------------------------------------------------------------------------
1 | # bzip2
2 |
3 | > A block-sorting file compressor.
4 |
5 | - Compress file:
6 |
7 | `bzip2 {{path/to/file_to_compress}}`
8 |
9 | - Decompress file:
10 |
11 | `bzip2 -d {{path/to/compressed_file.bz2}}`
12 |
13 | - Decompress to console:
14 |
15 | `bzip2 -dc {{path/to/compressed_file.bz2}}`
16 |
--------------------------------------------------------------------------------
/pages/osx/xed.md:
--------------------------------------------------------------------------------
1 | # xed
2 |
3 | > Opens files for editing in XCode.
4 |
5 | - Open file in XCode:
6 |
7 | `xed {{file1}}`
8 |
9 | - Open file(s) in XCode, create if it doesn't exist:
10 |
11 | `xed -c {{filename1}}`
12 |
13 | - Open a file in XCode and jump to line number 75:
14 |
15 | `xed -l 75 {{filename}}`
16 |
--------------------------------------------------------------------------------
/pages/common/virtualenv.md:
--------------------------------------------------------------------------------
1 | # virtualenv
2 |
3 | > Create virtual isolated Python environments.
4 |
5 | - Create a new environment:
6 |
7 | `virtualenv {{path/to/venv}}`
8 |
9 | - Start (select) the environment:
10 |
11 | `source {{path/to/venv}}/bin/activate`
12 |
13 | - Stop the environment:
14 |
15 | `deactivate`
16 |
--------------------------------------------------------------------------------
/pages/common/which.md:
--------------------------------------------------------------------------------
1 | # which
2 |
3 | > Locate the a program in the user's path.
4 |
5 | - Search the PATH environment variable and display the location of any matching executables:
6 |
7 | `which {{executable}}`
8 |
9 | - If there are multiple executables which match, display all:
10 |
11 | `which -a {{executable}}`
12 |
--------------------------------------------------------------------------------
/pages/linux/mkfs.cramfs.md:
--------------------------------------------------------------------------------
1 | # mkfs.cramfs
2 |
3 | > Creates a ROM filesystem inside a partition.
4 |
5 | - Create a ROM filesystem inside partition 1 on device b (`sdb1`):
6 |
7 | `mkfs.cramfs {{/dev/sdb1}}`
8 |
9 | - Create a ROM filesystem with a volume-name:
10 |
11 | `mkfs.cramfs -n {{volume-name}} {{/dev/sdb1}}`
12 |
--------------------------------------------------------------------------------
/pages/common/ab.md:
--------------------------------------------------------------------------------
1 | # ab
2 |
3 | > Apache Benchmarking tool. The simplest tool to perform a load testing.
4 |
5 | - Execute 100 HTTP GET requests to given URL:
6 |
7 | `ab -n 100 {{url}}`
8 |
9 | - Execute 100 HTTP GET requests, processing up to 10 requests concurrently, to given URL:
10 |
11 | `ab -n 100 -c 10 {{url}}`
12 |
--------------------------------------------------------------------------------
/pages/common/git-log.md:
--------------------------------------------------------------------------------
1 | # git log
2 |
3 | > Show a history of commits.
4 |
5 | - Show a history of commits:
6 |
7 | `git log`
8 |
9 | - Show the history of a particular file or directory, including differences:
10 |
11 | `git log -p {{path}}`
12 |
13 | - Show only the first line of each commits:
14 |
15 | `git log --oneline`
16 |
--------------------------------------------------------------------------------
/pages/common/sh.md:
--------------------------------------------------------------------------------
1 | # sh
2 |
3 | > Bourne shell.
4 | > The standard command language interpreter.
5 |
6 | - Start interactive shell:
7 |
8 | `sh`
9 |
10 | - Execute a command:
11 |
12 | `sh -c {{command}}`
13 |
14 | - Run commands from a file:
15 |
16 | `sh {{file.sh}}`
17 |
18 | - Run commands from STDIN:
19 |
20 | `sh -s`
21 |
--------------------------------------------------------------------------------
/pages/common/su.md:
--------------------------------------------------------------------------------
1 | # su
2 |
3 | > Switch shell to another user.
4 |
5 | - Switch to user {{username}} (password required):
6 |
7 | `su {{username}}`
8 |
9 | - Switch to superuser (admin password required):
10 |
11 | `su`
12 |
13 | - Switch to user {{username}} and simulate a full login shell:
14 |
15 | `su - {{username}}`
16 |
--------------------------------------------------------------------------------
/pages/linux/see.md:
--------------------------------------------------------------------------------
1 | # see
2 |
3 | > Alias to `run-mailcap`'s view.
4 | > An alias to a `run-mailcap`'s action print.
5 |
6 | - See action can be used to view any file (usually image) on default mailcap explorer:
7 |
8 | `see {{filename}}`
9 |
10 | - Using with `run-mailcap`:
11 |
12 | `run-mailcap --action=view {{filename}}`
13 |
--------------------------------------------------------------------------------
/pages/osx/mdfind.md:
--------------------------------------------------------------------------------
1 | # mdfind
2 |
3 | > List files matching a given query.
4 |
5 | - Find a file by its name:
6 |
7 | `mdfind -name {{file}}`
8 |
9 | - Find a file by its content:
10 |
11 | `mdfind {{query}}`
12 |
13 | - Find a file containing a string, in a given directory:
14 |
15 | `mdfind -onlyin {{directory}} {{query}}`
16 |
--------------------------------------------------------------------------------
/pages/osx/shutdown.md:
--------------------------------------------------------------------------------
1 | # shutdown
2 |
3 | > Shutdown and reboot the system.
4 |
5 | - Power off (halt) immediately:
6 |
7 | `shutdown -h now`
8 |
9 | - Sleep immediately:
10 |
11 | `shutdown -s now`
12 |
13 | - Reboot immediately:
14 |
15 | `shutdown -r now`
16 |
17 | - Reboot in 5 minutes:
18 |
19 | `shutdown -r +{{5}}`
20 |
--------------------------------------------------------------------------------
/pages/common/deluser.md:
--------------------------------------------------------------------------------
1 | # deluser
2 |
3 | > Remove a user account or remove a user from a group.
4 |
5 | - Remove a user:
6 |
7 | `deluser {{name}}`
8 |
9 | - Remove a user along with their home directory and mail spool:
10 |
11 | `deluser -r {{name}}`
12 |
13 | - Remove a user from a group:
14 |
15 | `deluser {{name}} {{group}}`
16 |
--------------------------------------------------------------------------------
/pages/common/dhcpwn.md:
--------------------------------------------------------------------------------
1 | # dhcpwn
2 |
3 | > Test DHCP IP exhaustion attacks and sniff local DHCP traffic.
4 |
5 | - Flood the network with IP requests:
6 |
7 | `dhcpwn --interface {{network_interface}} flood --count {{number_of_requests}}`
8 |
9 | - Sniff local DHCP traffic:
10 |
11 | `dhcpwn --interface {{network_interface}} sniff`
12 |
--------------------------------------------------------------------------------
/pages/common/zdb.md:
--------------------------------------------------------------------------------
1 | # zdb
2 |
3 | > ZFS debugger.
4 |
5 | - Show detailed configuration of all mounted ZFS zpools:
6 |
7 | `zdb`
8 |
9 | - Show detailed configuration for a specific ZFS pool:
10 |
11 | `zdb -C {{poolname}}`
12 |
13 | - Show statistics about number, size and deduplication of blocks:
14 |
15 | `zdb -b {{poolname}}`
16 |
--------------------------------------------------------------------------------
/pages/linux/locate.md:
--------------------------------------------------------------------------------
1 | # locate
2 |
3 | > Find filenames quickly.
4 |
5 | - Look for pattern in the database. Note: the database is recomputed periodically (usually weekly or daily):
6 |
7 | `locate {{pattern}}`
8 |
9 | - Recompute the database. You need to do it if you want to find recently added files:
10 |
11 | `sudo updatedb`
12 |
--------------------------------------------------------------------------------
/pages/common/java.md:
--------------------------------------------------------------------------------
1 | # java
2 |
3 | > Java Application Launcher.
4 |
5 | - Execute a java .class file that contains a main method by using just the class name:
6 |
7 | `java {{filename}}`
8 |
9 | - Execute a .jar program:
10 |
11 | `java -jar {{filename.jar}}`
12 |
13 | - Display JDK, JRE and HotSpot versions:
14 |
15 | `java -version`
16 |
--------------------------------------------------------------------------------
/pages/linux/dpkg.md:
--------------------------------------------------------------------------------
1 | # dpkg
2 |
3 | > Debian package manager.
4 |
5 | - Install a package:
6 |
7 | `dpkg -i {{/path/to/file}}`
8 |
9 | - Remove a package:
10 |
11 | `dpkg -r {{package_name}}`
12 |
13 | - List installed packages:
14 |
15 | `dpkg -l {{pattern}}`
16 |
17 | - List package contents:
18 |
19 | `dpkg -L {{package_name}}`
20 |
--------------------------------------------------------------------------------
/pages/linux/htop.md:
--------------------------------------------------------------------------------
1 | # htop
2 |
3 | > Display dynamic real-time information about running processes. An enchanced version of `top`.
4 |
5 | - Start htop:
6 |
7 | `htop`
8 |
9 | - Start htop displaying only processes owned by given user:
10 |
11 | `htop -u {{user-name}}`
12 |
13 | - Get help about interactive commands:
14 |
15 | `?`
16 |
--------------------------------------------------------------------------------
/pages/linux/pwgen.md:
--------------------------------------------------------------------------------
1 | # pwgen
2 |
3 | > Generate pronounceable passwords.
4 |
5 | - Generate random password with symbols:
6 |
7 | `pwgen -y {{length}}`
8 |
9 | - Generate hard-to-memorize passwords:
10 |
11 | `pwgen -s {{length}}`
12 |
13 | - Generate password with at least one capital letter in them:
14 |
15 | `pwgen -c {{length}}`
16 |
--------------------------------------------------------------------------------
/pages/linux/systemd-analyze.md:
--------------------------------------------------------------------------------
1 | # systemd-analyze
2 |
3 | > Show timing details about the boot process of units (services, mount points, devices, sockets).
4 |
5 | - List time of each unit to start up:
6 |
7 | `systemd-analyze blame`
8 |
9 | - Print a tree of the time critical chain of units:
10 |
11 | `systemd-analyze critical-chain`
12 |
--------------------------------------------------------------------------------
/pages/osx/nm.md:
--------------------------------------------------------------------------------
1 | # nm
2 |
3 | > List symbol names in object files (see c++filt).
4 |
5 | - List global (extern) functions in a file (prefixed with T):
6 |
7 | `nm -g {{file.o}}`
8 |
9 | - List only undefined symbols in a file:
10 |
11 | `nm -u {{file.o}}`
12 |
13 | - List all symbols, even debugging symbols:
14 |
15 | `nm -a {{file.o}}`
16 |
--------------------------------------------------------------------------------
/pages/common/arp.md:
--------------------------------------------------------------------------------
1 | # arp
2 |
3 | > Show and manipulate your system's ARP cache.
4 |
5 | - Show current arp table:
6 |
7 | `arp -a`
8 |
9 | - Clear the entire cache:
10 |
11 | `sudo arp -a -d`
12 |
13 | - Delete a specific entry:
14 |
15 | `arp -d {{address}}`
16 |
17 | - Create an entry:
18 |
19 | `arp -s {{address}} {{mac address}}`
20 |
--------------------------------------------------------------------------------
/pages/common/git-checkout.md:
--------------------------------------------------------------------------------
1 | # git checkout
2 |
3 | > Checkout a branch or paths to the working tree.
4 |
5 | - Switch to another branch:
6 |
7 | `git checkout {{BRANCH-NAME}}`
8 |
9 | - Create and switch to a new branch:
10 |
11 | `git checkout -b {{BRANCH-NAME}}`
12 |
13 | - Undo unstaged local modification:
14 |
15 | `git checkout .`
16 |
--------------------------------------------------------------------------------
/pages/common/jobs.md:
--------------------------------------------------------------------------------
1 | # jobs
2 |
3 | > Display status of jobs in the current session.
4 |
5 | - Show status of all jobs:
6 |
7 | `jobs`
8 |
9 | - Show status of a particular job:
10 |
11 | `jobs {{job_id}}`
12 |
13 | - Show status and process IDs of all jobs:
14 |
15 | `jobs -l`
16 |
17 | - Show process IDs of all jobs:
18 |
19 | `jobs -p`
20 |
--------------------------------------------------------------------------------
/pages/common/nano.md:
--------------------------------------------------------------------------------
1 | # nano
2 |
3 | > Simple, easy to use editor. An enhanced, free Pico clone.
4 |
5 | - Start nano in terminal with {filename}:
6 |
7 | `nano {{filename}}`
8 |
9 | - Enable smooth scrolling:
10 |
11 | `nano -S {{filename}}`
12 |
13 | - Indent new lines to the previous lines' indentation:
14 |
15 | `nano -i {{filename}}`
16 |
--------------------------------------------------------------------------------
/pages/common/rustc.md:
--------------------------------------------------------------------------------
1 | # rustc
2 |
3 | > The Rust compiler.
4 | > Processes, compiles and links Rust language source files.
5 |
6 | - Compile a single file:
7 |
8 | `rustc {{file.rs}}`
9 |
10 | - Compile with high optimization:
11 |
12 | `rustc -O {{file.rs}}`
13 |
14 | - Compile with debugging information:
15 |
16 | `rustc -g {{file.rs}}`
17 |
--------------------------------------------------------------------------------
/pages/linux/edit.md:
--------------------------------------------------------------------------------
1 | # edit
2 |
3 | > An alias to a `run-mailcap`'s action edit.
4 | > Originally `run-mailcap` is used to process/edit mime-type/file.
5 |
6 | - Edit action can be used to view any file on default mailcap explorer:
7 |
8 | `edit {{filename}}`
9 |
10 | - With `run-mailcap`:
11 |
12 | `run-mailcap --action=edit {{filename}}`
13 |
--------------------------------------------------------------------------------
/pages/linux/print.md:
--------------------------------------------------------------------------------
1 | # print
2 |
3 | > An alias to a `run-mailcap`'s action print.
4 | > Originally `run-mailcap` is used to process mime-type/file.
5 |
6 | - Print action can be used to print any file on default run-mailcap tool:
7 |
8 | `print {{filename}}`
9 |
10 | - With `run-mailcap`:
11 |
12 | `run-mailcap --action=print {{filename}}`
13 |
--------------------------------------------------------------------------------
/pages/common/bash.md:
--------------------------------------------------------------------------------
1 | # bash
2 |
3 | > Bourne-Again SHell.
4 | > `sh`-compatible command line interpreter.
5 |
6 | - Start interactive shell:
7 |
8 | `bash`
9 |
10 | - Execute a command:
11 |
12 | `bash -c {{command}}`
13 |
14 | - Run commands from a file:
15 |
16 | `bash {{file.sh}}`
17 |
18 | - Run commands from STDIN:
19 |
20 | `bash -s`
21 |
--------------------------------------------------------------------------------
/pages/osx/locate.md:
--------------------------------------------------------------------------------
1 | # locate
2 |
3 | > Find filenames quickly.
4 |
5 | - Look for pattern in the database. Note: the database is recomputed periodically (usually weekly or daily):
6 |
7 | `locate {{pattern}}`
8 |
9 | - Recompute the database. You need to do it if you want to find recently added files:
10 |
11 | `sudo /usr/libexec/locate.updatedb`
12 |
--------------------------------------------------------------------------------
/pages/common/crontab.md:
--------------------------------------------------------------------------------
1 | # crontab
2 |
3 | > Schedule cron jobs to run on a time interval for the current user.
4 |
5 | - Edit the crontab file for the current user:
6 |
7 | `crontab -e`
8 |
9 | - View a list of existing cron jobs for current user:
10 |
11 | `crontab -l`
12 |
13 | - Remove all cron jobs for the current user:
14 |
15 | `crontab -r`
16 |
--------------------------------------------------------------------------------
/pages/osx/qlmanage.md:
--------------------------------------------------------------------------------
1 | # qlmanage
2 |
3 | > QuickLook server tool.
4 |
5 | - Display QuickLook for one or multiple files:
6 |
7 | `qlmanage -p {{filename}} {{filename2}}`
8 |
9 | - Compute 300px wide PNG thumbnails of all JPEGs in the current directory and put them in a directory:
10 |
11 | `qlmanage *.jpg -t -s 300 {{/existing//thumbnail/directory}}`
12 |
--------------------------------------------------------------------------------
/pages/common/cd.md:
--------------------------------------------------------------------------------
1 | # cd
2 |
3 | > Change the current working directory.
4 |
5 | - Go to the given directory:
6 |
7 | `cd {{/path/to/directory}}`
8 |
9 | - Go to home directory of current user:
10 |
11 | `cd`
12 |
13 | - Go up to the parent of the current directory:
14 |
15 | `cd ..`
16 |
17 | - Go to the previously chosen directory:
18 |
19 | `cd -`
20 |
--------------------------------------------------------------------------------
/pages/common/pushd.md:
--------------------------------------------------------------------------------
1 | # pushd
2 |
3 | > Place a directory on a stack so it can be accessed later.
4 |
5 | - Switch to directory and push it on the stack:
6 |
7 | `pushd < {{directory}}`
8 |
9 | - Switch first and second directories on the stack:
10 |
11 | `pushd`
12 |
13 | - Rotate stack by making the 5th element the top of the stack:
14 |
15 | `pushd +4`
16 |
--------------------------------------------------------------------------------
/pages/common/base32.md:
--------------------------------------------------------------------------------
1 | # base32
2 |
3 | > Encode or decode file or standard input, to standard output.
4 |
5 | - Encode a file:
6 |
7 | `base32 {{filename}}`
8 |
9 | - Decode a file:
10 |
11 | `base32 -d {{filename}}`
12 |
13 | - Encode from stdin:
14 |
15 | `{{somecommand}} | base32`
16 |
17 | - Decode from stdin:
18 |
19 | `{{somecommand}} | base32 -d`
20 |
--------------------------------------------------------------------------------
/pages/common/base64.md:
--------------------------------------------------------------------------------
1 | # base64
2 |
3 | > Encode or decode file or standard input, to standard output.
4 |
5 | - Encode a file:
6 |
7 | `base64 {{filename}}`
8 |
9 | - Decode a file:
10 |
11 | `base64 -d {{filename}}`
12 |
13 | - Encode from stdin:
14 |
15 | `{{somecommand}} | base64`
16 |
17 | - Decode from stdin:
18 |
19 | `{{somecommand}} | base64 -d`
20 |
--------------------------------------------------------------------------------
/pages/common/git-rm.md:
--------------------------------------------------------------------------------
1 | # git rm
2 |
3 | > Remove files from repository index and local filesystem.
4 |
5 | - Remove file from repository index and filesystem:
6 |
7 | `git rm {{file}}`
8 |
9 | - Remove directory:
10 |
11 | `git rm -r {{directory}}`
12 |
13 | - Remove file from repository index but keep it untouched locally:
14 |
15 | `git rm --cached {{file}}`
16 |
--------------------------------------------------------------------------------
/pages/common/mysqldump.md:
--------------------------------------------------------------------------------
1 | # mysqldump
2 |
3 | > Backups mysql databases.
4 |
5 | - Create a backup, user will be prompted for a password:
6 |
7 | `mysqldump -u {{user}} --password {{database_name}} > {{filename.sql}}`
8 |
9 | - Restore a backup, user will be prompted for a password:
10 |
11 | `mysql -u {{user}} --password {{database_name}} < {{filename.sql}}`
12 |
--------------------------------------------------------------------------------
/pages/common/sum.md:
--------------------------------------------------------------------------------
1 | # sum
2 |
3 | > Compute checksums and the number of blocks for a file.
4 | > A predecessor to the more modern `cksum`.
5 |
6 | - Compute a checksum with BSD-compatible algorithm and 1024-byte blocks:
7 |
8 | `sum {{file}}`
9 |
10 | - Compute a checksum with System V-compatible algorithm and 512-byte blocks:
11 |
12 | `sum --sysv {{file}}`
13 |
--------------------------------------------------------------------------------
/pages/linux/wall.md:
--------------------------------------------------------------------------------
1 | # wall
2 |
3 | > Write a message on the terminals of users currently logged in.
4 | > Only available to super-user.
5 |
6 | - Send a message:
7 |
8 | `echo "{{message}}" | wall`
9 |
10 | - Send a message from a file:
11 |
12 | `wall {{file}}`
13 |
14 | - Send a message with timeout (default 300):
15 |
16 | `wall -t {{seconds}} {{file}}`
17 |
--------------------------------------------------------------------------------
/pages/osx/base64.md:
--------------------------------------------------------------------------------
1 | # base64
2 |
3 | > Encode and decode using Base64 representation.
4 |
5 | - Encode a file:
6 |
7 | `base64 -i {{plain_file}}`
8 |
9 | - Decode a file:
10 |
11 | `base64 -D -i {{base64_file}}`
12 |
13 | - Encode from stdin:
14 |
15 | `echo {{plain_text}} | base64`
16 |
17 | - Decode from stdin:
18 |
19 | `echo {{base64_text}} | base64 -D`
20 |
--------------------------------------------------------------------------------
/pages/common/wc.md:
--------------------------------------------------------------------------------
1 | # wc
2 |
3 | > Count words, bytes, or lines.
4 |
5 | - Count lines in file:
6 |
7 | `wc -l {{file}}`
8 |
9 | - Count words in file:
10 |
11 | `wc -w {{file}}`
12 |
13 | - Count characters (bytes) in file:
14 |
15 | `wc -c {{file}}`
16 |
17 | - Count characters in file (taking multi-byte character sets into account):
18 |
19 | `wc -m {{file}}`
20 |
--------------------------------------------------------------------------------
/pages/linux/compose.md:
--------------------------------------------------------------------------------
1 | # compose
2 |
3 | > An alias to a `run-mailcap`'s action compose.
4 | > Originally `run-mailcap` is used to mime-type/file.
5 |
6 | - Compose action can be used to compose any existing file or new on default mailcap edit tool:
7 |
8 | `compose {{filename}}`
9 |
10 | - With `run-mailcap`:
11 |
12 | `run-mailcap --action=compose {{filename}}`
13 |
--------------------------------------------------------------------------------
/pages/osx/w.md:
--------------------------------------------------------------------------------
1 | # w
2 |
3 | > Show who is logged on and what they are doing.
4 | > Print user login, TTY, remote host, login time, idle time, current process.
5 |
6 | - Show logged-in users info:
7 |
8 | `w`
9 |
10 | - Show logged-in users info without a header:
11 |
12 | `w -h`
13 |
14 | - Show info about logged-in users, sorted by their idle time:
15 |
16 | `w -i`
17 |
--------------------------------------------------------------------------------
/pages/common/apm.md:
--------------------------------------------------------------------------------
1 | # apm
2 |
3 | > Atom editor Package Manager.
4 | > See `atom`.
5 |
6 | - Install packages from http://atom.io/packages and themes from http://atom.io/themes:
7 |
8 | `apm install {{package_name}}`
9 |
10 | - Remove packages/themes:
11 |
12 | `apm remove {{package_name}}`
13 |
14 | - Upgrade packages/themes:
15 |
16 | `apm upgrade {{package_name}}`
17 |
--------------------------------------------------------------------------------
/pages/linux/chattr.md:
--------------------------------------------------------------------------------
1 | # chattr
2 |
3 | > Change attributes of files or folders.
4 |
5 | - Make a file or folder immutable to changes and deletion, even by superuser:
6 |
7 | `chattr +i {{path}}`
8 |
9 | - Make a file or folder mutable:
10 |
11 | `chattr -i {{path}}`
12 |
13 | - Recursively make an entire folder and contents immutable:
14 |
15 | `chattr -R +i {{folder}}`
16 |
--------------------------------------------------------------------------------
/pages/sunos/devfsadm.md:
--------------------------------------------------------------------------------
1 | # devfsadm
2 |
3 | > Administration command for `/dev`. Maintains the `/dev` namespace.
4 |
5 | - Scan for new disks:
6 |
7 | `devfsadm -c disk`
8 |
9 | - Cleanup any dangling /dev links and scan for new device:
10 |
11 | `devfsadm -C -v`
12 |
13 | - Dry-run - output what would be changed but make no modifications:
14 |
15 | `devfsadm -C -v -n`
16 |
--------------------------------------------------------------------------------
/pages/sunos/svccfg.md:
--------------------------------------------------------------------------------
1 | # svccfg
2 |
3 | > Import, export, and modify service configurations.
4 |
5 | - Validate configuration file:
6 |
7 | `svccfg validate {{smf.xml}}`
8 |
9 | - Export service configurations to file:
10 |
11 | `svccfg export {{servicename}} > {{smf.xml}}`
12 |
13 | - Import/update service configurations from file:
14 |
15 | `svccfg import {{smf.xml}}`
16 |
--------------------------------------------------------------------------------
/pages/common/umount.md:
--------------------------------------------------------------------------------
1 | # umount
2 |
3 | > Revokes access to an entire filesystem mounted to a directory.
4 | > A filesystem cannot be unmounted when it is busy.
5 |
6 | - Unmount a filesystem:
7 |
8 | `umount {{path/to/device_file}}`
9 |
10 | - OR:
11 |
12 | `umount {{path/to/mounted_directory}}`
13 |
14 | - Unmount all mounted filesystems (dangerous!):
15 |
16 | `umount -a`
17 |
--------------------------------------------------------------------------------
/pages/linux/xinput.md:
--------------------------------------------------------------------------------
1 | # xinput
2 |
3 | > List available input devices, query information about a device and change input device settings.
4 |
5 | - List all input devices:
6 |
7 | `xinput list`
8 |
9 | - Disconnect an input from its master:
10 |
11 | `xinput float {{id}}`
12 |
13 | - Reattach an input as slave to a master:
14 |
15 | `xinput reattach {{id}} {{master_id}}`
16 |
--------------------------------------------------------------------------------
/pages/common/tail.md:
--------------------------------------------------------------------------------
1 | # tail
2 |
3 | > Display the last part of a file.
4 |
5 | - Show last 'num' lines in file:
6 |
7 | `tail -n {{num}} {{file}}`
8 |
9 | - Show all file since line 'num':
10 |
11 | `tail -n +{{num}} {{file}}`
12 |
13 | - Show last 'num' bytes in file:
14 |
15 | `tail -c {{num}} {{file}}`
16 |
17 | - Keep reading file until ctrl-c:
18 |
19 | `tail -f {{file}}`
20 |
--------------------------------------------------------------------------------
/pages/linux/free.md:
--------------------------------------------------------------------------------
1 | # free
2 |
3 | > Display amount of free and used memory in the system.
4 |
5 | - Display system memory:
6 |
7 | `free`
8 |
9 | - Display memory in Bytes/KB/MB/GB:
10 |
11 | `free {{-b/-k/-m/-g}}`
12 |
13 | - Display memory in human readable units:
14 |
15 | `free -h`
16 |
17 | - Continuous monitor memory (refresh every X seconds):
18 |
19 | `free -s {{X}}`
20 |
--------------------------------------------------------------------------------
/pages/linux/md5sum.md:
--------------------------------------------------------------------------------
1 | # md5sum
2 |
3 | > Calculate MD5 cryptographic checksums.
4 |
5 | - Calculate the MD5 checksum for a file:
6 |
7 | `md5sum {{filename1}}`
8 |
9 | - Calculate MD5 checksums for multiple files:
10 |
11 | `md5sum {{filename1}} {{filename2}}`
12 |
13 | - Read a file of MD5SUMs and verify all files have matching checksums:
14 |
15 | `md5sum -c {{filename.md5}}`
16 |
--------------------------------------------------------------------------------
/pages/common/bc.md:
--------------------------------------------------------------------------------
1 | # bc
2 |
3 | > Calculator.
4 |
5 | - Run calculator in interactive mode:
6 |
7 | `bc -i`
8 |
9 | - Calculate the result of an expression:
10 |
11 | `bc <<< "(1 + 2) * 2 ^ 2"`
12 |
13 | - Calculate with the given precision:
14 |
15 | `bc <<< "scale=10; 5 / 3"`
16 |
17 | - Calculate expression with sine and cosine using mathlib:
18 |
19 | `bc -l <<< "s(1) + c(1)"`
20 |
--------------------------------------------------------------------------------
/pages/common/git-svn.md:
--------------------------------------------------------------------------------
1 | # git svn
2 |
3 | > Bidirectional operation between a Subversion repository and Git.
4 |
5 | - Clone an SVN repository:
6 |
7 | `git svn clone {{http://example.com/my_subversion_repo}} {{local_dir}}`
8 |
9 | - Update local clone from the upstream SVN repository:
10 |
11 | `git svn rebase`
12 |
13 | - Commit back to SVN repository:
14 |
15 | `git svn dcommit`
16 |
--------------------------------------------------------------------------------
/pages/common/jstack.md:
--------------------------------------------------------------------------------
1 | # jstack
2 |
3 | > Java Stack Trace Tool.
4 |
5 | - Print java stack traces for all threads in a java process:
6 |
7 | `jstack {{java_pid}}`
8 |
9 | - Print mixed mode (java/c++) stack traces for all threads in a java process:
10 |
11 | `jstack -m {{java_pid}}`
12 |
13 | - Print stack traces from java core dump:
14 |
15 | `jstack {{/usr/bin/java}} {{file.core}}`
16 |
--------------------------------------------------------------------------------
/pages/common/shred.md:
--------------------------------------------------------------------------------
1 | # shred
2 |
3 | > Overwrite files to securely delete data.
4 |
5 | - Overwrite a file:
6 |
7 | `shred {{file}}`
8 |
9 | - Overwrite a file, leaving zeroes instead of random data:
10 |
11 | `shred --zero {{file}}`
12 |
13 | - Overwrite a file 25 times:
14 |
15 | `shred -n25 {{file}}`
16 |
17 | - Overwrite a file and remove it:
18 |
19 | `shred --remove {{file}}`
20 |
--------------------------------------------------------------------------------
/pages/common/x_x.md:
--------------------------------------------------------------------------------
1 | # x_x
2 |
3 | > View Excel and CSV files from the command-line.
4 |
5 | - View an XLSX or CSV file:
6 |
7 | `x_x {{file.ext}}`
8 |
9 | - View an XLSX or CSV file, using the first row as table headers:
10 |
11 | `x_x -h {{0}} {{file.ext}}`
12 |
13 | - View a CSV file with unconventional delimiters:
14 |
15 | `x_x --delimiter={{';'}} --quotechar={{'|'}} {{file.csv}}`
16 |
--------------------------------------------------------------------------------
/pages/linux/watch.md:
--------------------------------------------------------------------------------
1 | # watch
2 |
3 | > Execute a command repeatedly, and monitor the output in full-screen mode.
4 |
5 | - Monitor files in the current folder:
6 |
7 | `watch {{ls}}`
8 |
9 | - Monitor disk space and highlight the changes:
10 |
11 | `watch -d {{df}}`
12 |
13 | - Monitor "node" processes, refreshing every 3 seconds:
14 |
15 | `watch -n {{3}} "{{ps aux | grep node}}"`
16 |
--------------------------------------------------------------------------------
/pages/common/gdb.md:
--------------------------------------------------------------------------------
1 | # gdb
2 |
3 | > The GNU Debugger.
4 |
5 | - Debug an executable:
6 |
7 | `gdb {{executable}}`
8 |
9 | - Attach a process to gdb:
10 |
11 | `gdb -p {{procID}}`
12 |
13 | - Execute given GDB commands upon start:
14 |
15 | `gdb -ex "{{commands}}" {{executable}}`
16 |
17 | - Start gdb and pass arguments:
18 |
19 | `gdb --args {{executable}} {{argument1}} {{argument2}}`
20 |
--------------------------------------------------------------------------------
/pages/common/history.md:
--------------------------------------------------------------------------------
1 | # history
2 |
3 | > Command Line history.
4 |
5 | - Display the commands history list with line numbers:
6 |
7 | `history`
8 |
9 | - Clear the commands history list (only for current `bash` shell):
10 |
11 | `history -c`
12 |
13 | - Overwrite history file with history of current `bash` shell (often combined with `history -c` to purge history):
14 |
15 | `history -w`
16 |
--------------------------------------------------------------------------------
/pages/common/more.md:
--------------------------------------------------------------------------------
1 | # more
2 |
3 | > Opens a file for reading.
4 | > Allows movement and search in forward direction only.
5 | > Doesn't read the entire file (suitable for logs).
6 |
7 | - Open a file:
8 |
9 | `more {{source_file}}`
10 |
11 | - Page down:
12 |
13 | `d (next)`
14 |
15 | - Search for a string:
16 |
17 | `/{{something}} then n (next)`
18 |
19 | - Exit:
20 |
21 | `q`
22 |
--------------------------------------------------------------------------------
/pages/common/route.md:
--------------------------------------------------------------------------------
1 | # route
2 |
3 | > Use route cmd to set the route table .
4 |
5 | - Display the information of route table:
6 |
7 | `route -n`
8 |
9 | - Add route rule:
10 |
11 | `sudo route add -net {{ip_address}} netmask {{netmask_address}} gw {{gw_address}}`
12 |
13 | - Delete route rule:
14 |
15 | `sudo route del -net {{ip_address}} netmask {{netmask_address}} dev {{gw_address}}`
16 |
--------------------------------------------------------------------------------
/pages/common/watch.md:
--------------------------------------------------------------------------------
1 | # watch
2 |
3 | > Execute a program periodically, showing output fullscreen.
4 |
5 | - Repeatedly run a command and show the result:
6 |
7 | `watch {{command}}`
8 |
9 | - Re-run a command every 60 seconds:
10 |
11 | `watch -n {{60}} {{command}}`
12 |
13 | - Monitor the contents of a directory, highlighting differences as they appear:
14 |
15 | `watch -d {{ls -l}}`
16 |
--------------------------------------------------------------------------------
/pages/linux/sha1sum.md:
--------------------------------------------------------------------------------
1 | # sha1sum
2 |
3 | > Calculate SHA1 cryptographic checksums.
4 |
5 | - Calculate the SHA1 checksum for a file:
6 |
7 | `sha1sum {{filename1}}`
8 |
9 | - Calculate SHA1 checksums for multiple files:
10 |
11 | `sha1sum {{filename1}} {{filename2}}`
12 |
13 | - Read a file of SHA1 sums and verify all files have matching checksums:
14 |
15 | `sha1sum -c {{filename.sha1}}`
16 |
--------------------------------------------------------------------------------
/pages/linux/usermod.md:
--------------------------------------------------------------------------------
1 | # usermod
2 |
3 | > Modifies a user account.
4 |
5 | - Change a user's name:
6 |
7 | `usermod -l {{newname}} {{user}}`
8 |
9 | - Add user to supplementary groups (mind the whitespace):
10 |
11 | `usermod -a -G {{group1,group2}} {{user}}`
12 |
13 | - Create a new home directory for a user and move their files to it:
14 |
15 | `usermod -m -d {{/path/to/home}} {{user}}`
16 |
--------------------------------------------------------------------------------
/pages/osx/airport.md:
--------------------------------------------------------------------------------
1 | # airport
2 |
3 | > Wireless network configuration utility.
4 |
5 | - Show current wireless status information:
6 |
7 | `airport -I`
8 |
9 | - Sniff wireless traffic on channel 1:
10 |
11 | `airport sniff {{1}}`
12 |
13 | - Scan for available wireless networks:
14 |
15 | `airport -s`
16 |
17 | - Disassociate from current airport network:
18 |
19 | `sudo airport -z`
20 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tldr-electron",
3 | "version": "0.1.0",
4 | "main": "main.js",
5 | "author": "Terence Ng Wai Tung",
6 | "devDependencies": {
7 | "electron-prebuilt": "^1.2.7"
8 | },
9 | "dependencies": {
10 | "adm-zip": "^0.4.7",
11 | "fs-jetpack": "^0.9.2",
12 | "handlebars": "^4.0.5",
13 | "request": "^2.73.0",
14 | "showdown": "^1.4.2"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/pages/common/git-submodule.md:
--------------------------------------------------------------------------------
1 | # git submodule
2 |
3 | > Inspects, updates and manages submodules.
4 |
5 | - Install a repository's specified submodules:
6 |
7 | `git submodule update --init --recursive`
8 |
9 | - Add a git repository as a submodule:
10 |
11 | `git submodule add {{repository-url}}`
12 |
13 | - Update every submodule to its latest commit:
14 |
15 | `git submodule foreach git pull`
16 |
--------------------------------------------------------------------------------
/pages/common/patch.md:
--------------------------------------------------------------------------------
1 | # patch
2 |
3 | > Patch a file (or files) with a diff file.
4 | > Note that diff files contain both the target filenames and list of changes.
5 |
6 | - Apply a patch:
7 |
8 | `patch < {{patchfile}}.diff`
9 |
10 | - Apply a patch to current directory:
11 |
12 | `patch -p1 < {{patchfile}}.diff`
13 |
14 | - Apply the reverse of a patch:
15 |
16 | `patch -R < {{patchfile}}.diff`
17 |
--------------------------------------------------------------------------------
/pages/common/unzip.md:
--------------------------------------------------------------------------------
1 | # unzip
2 |
3 | > Extract compressed files in a ZIP archive.
4 |
5 | - Extract zip file(s) (for multiple files, seperate file paths by spaces):
6 |
7 | `unzip {{file(s)}}`
8 |
9 | - Extract zip files(s) to given path:
10 |
11 | `unzip {{files(s)}} -d {{/path/to/put/extracted/files}}`
12 |
13 | - List the contents of a zip file without extracting:
14 |
15 | `unzip -l {{file}}`
16 |
--------------------------------------------------------------------------------
/pages/linux/ssh-copy-id.md:
--------------------------------------------------------------------------------
1 | # ssh-copy-id
2 |
3 | > Install your public key in a remote machine's authorized_keys.
4 |
5 | - Copy the given public key to the remote:
6 |
7 | `ssh-copy-id -i {{path/to/certificate}} {{username}}@{{remote_host}}`
8 |
9 | - Copy the given public key to the remote with specific port:
10 |
11 | `ssh-copy-id -i {{path/to/certificate}} -p {{port}} {{username}}@{{remote_host}}`
12 |
--------------------------------------------------------------------------------
/pages/common/gunzip.md:
--------------------------------------------------------------------------------
1 | # gunzip
2 |
3 | > Extract file(s) from a gzip (.gz) archive.
4 |
5 | - Extract a file from an archive, replacing the original file if it exists:
6 |
7 | `gunzip {{archive.tar.gz}}`
8 |
9 | - Extract a file to a target destination:
10 |
11 | `gunzip -c {{archive.tar.gz}} > {{archive.tar}}`
12 |
13 | - List the contents of a compressed file:
14 |
15 | `gunzip -l {{file.txt.gz}}`
16 |
--------------------------------------------------------------------------------
/pages/common/ln.md:
--------------------------------------------------------------------------------
1 | # ln
2 |
3 | > Creates links to files and folders.
4 |
5 | - Create a symbolic link to a file (or folder):
6 |
7 | `ln -s {{path/to/file}} {{path/to/symlink}}`
8 |
9 | - Overwrite an existing symbolic to point to a different file:
10 |
11 | `ln -sf {{path/to/new/file}} {{path/to/symlink}}`
12 |
13 | - Create a hard link to a file:
14 |
15 | `ln {{path/to/file}} {{path/to/hardlink}}`
16 |
--------------------------------------------------------------------------------
/pages/common/mtr.md:
--------------------------------------------------------------------------------
1 | # mtr
2 |
3 | > Combined traceroute and ping tool.
4 |
5 | - Traceroute to a host and continuously ping all intermediary hops:
6 |
7 | `mtr {{host}}`
8 |
9 | - Disable IP address and host name mapping:
10 |
11 | `mtr -n {{host}}`
12 |
13 | - Generate output after pinging each hop 10 times:
14 |
15 | `mtr -w {{host}}`
16 |
17 | - Force IP IPv4 or IPV6:
18 |
19 | `mtr -4 {{host}}`
20 |
--------------------------------------------------------------------------------
/pages/common/telnet.md:
--------------------------------------------------------------------------------
1 | # telnet
2 |
3 | > Telnet is used to connect to a specified port of a host.
4 |
5 | - Telnet to a certain port:
6 |
7 | `telnet {{ip_address}} {{port}}`
8 |
9 | - To exit a telnet session:
10 |
11 | `quit`
12 |
13 | - Default escape character:
14 |
15 | `CTRL + ]`
16 |
17 | - Specify an escape character (x is the escape character):
18 |
19 | `telnet -e x {{ip_address}} {{port}}`
20 |
--------------------------------------------------------------------------------
/pages/linux/mkfs.ntfs.md:
--------------------------------------------------------------------------------
1 | # mkfs.ntfs
2 |
3 | > Creates a NTFS filesystem inside a partition.
4 |
5 | - Create a NTFS filesystem inside partition 1 on device b (`sdb1`):
6 |
7 | `mkfs.ntfs {{/dev/sdb1}}`
8 |
9 | - Create filesystem with a volume-label:
10 |
11 | `mkfs.ntfs -L {{volume-label}} {{/dev/sdb1}}`
12 |
13 | - Create filesystem with specific UUID:
14 |
15 | `mkfs.ntfs -U {{UUID}} {{/dev/sdb1}}`
16 |
--------------------------------------------------------------------------------
/pages/linux/ulimit.md:
--------------------------------------------------------------------------------
1 | # ulimit
2 |
3 | > Get and set user limits.
4 |
5 | - Get the properties of all the user limits:
6 |
7 | `ulimit -a`
8 |
9 | - Get hard limit for the number of simultaneously opened files:
10 |
11 | `ulimit -H -n`
12 |
13 | - Get soft limit for the number of simultaneously opened files:
14 |
15 | `ulimit -S -n`
16 |
17 | - Set max per-user process limit:
18 |
19 | `ulimit -u 30`
20 |
--------------------------------------------------------------------------------
/pages/common/cowsay.md:
--------------------------------------------------------------------------------
1 | # cowsay
2 |
3 | > Generate an ASCII character like a cow or sheep saying or thinking something.
4 |
5 | - Print an ASCII cow saying "Hello world!":
6 |
7 | `cowsay "Hello world!"`
8 |
9 | - Print an ASCII dragon saying "Hello!":
10 |
11 | `echo "Hello!" | cowsay -f dragon`
12 |
13 | - Print a stoned thinking ASCII cow:
14 |
15 | `cowthink -s "I'm just a cow, not a great thinker ..."`
16 |
--------------------------------------------------------------------------------
/pages/common/pngcrush.md:
--------------------------------------------------------------------------------
1 | # pngcrush
2 |
3 | > PNG image compression utility.
4 |
5 | - Compress a PNG file:
6 |
7 | `pngcrush {{in.png}} {{out.png}}`
8 |
9 | - Compress all PNGs and output to directory:
10 |
11 | `pngcrush -d {{path/to/output}} *.png`
12 |
13 | - Compress PNG file with all 114 available algorithms and pick the best result:
14 |
15 | `pngcrush -rem allb -brute -reduce {{in.png}} {{out.png}}`
16 |
--------------------------------------------------------------------------------
/pages/linux/sha224sum.md:
--------------------------------------------------------------------------------
1 | # sha224sum
2 |
3 | > Calculate SHA224 cryptographic checksums.
4 |
5 | - Calculate the SHA224 checksum for a file:
6 |
7 | `sha224sum {{filename1}}`
8 |
9 | - Calculate SHA224 checksums for multiple files:
10 |
11 | `sha224sum {{filename1}} {{filename2}}`
12 |
13 | - Read a file of SHA224 sums and verify all files have matching checksums:
14 |
15 | `sha224sum -c {{filename.sha224}}`
16 |
--------------------------------------------------------------------------------
/pages/linux/sha256sum.md:
--------------------------------------------------------------------------------
1 | # sha256sum
2 |
3 | > Calculate SHA256 cryptographic checksums.
4 |
5 | - Calculate the SHA256 checksum for a file:
6 |
7 | `sha256sum {{filename1}}`
8 |
9 | - Calculate SHA224 checksums for multiple files:
10 |
11 | `sha256sum {{filename1}} {{filename2}}`
12 |
13 | - Read a file of SHA256 sums and verify all files have matching checksums:
14 |
15 | `sha256sum -c {{filename.sha256}}`
16 |
--------------------------------------------------------------------------------
/pages/linux/sha384sum.md:
--------------------------------------------------------------------------------
1 | # sha384sum
2 |
3 | > Calculate SHA384 cryptographic checksums.
4 |
5 | - Calculate the SHA384 checksum for a file:
6 |
7 | `sha384sum {{filename1}}`
8 |
9 | - Calculate SHA384 checksums for multiple files:
10 |
11 | `sha384sum {{filename1}} {{filename2}}`
12 |
13 | - Read a file of SHA384 sums and verify all files have matching checksums:
14 |
15 | `sha384sum -c {{filename.sha384}}`
16 |
--------------------------------------------------------------------------------
/pages/linux/sha512sum.md:
--------------------------------------------------------------------------------
1 | # sha512sum
2 |
3 | > Calculate SHA512 cryptographic checksums.
4 |
5 | - Calculate the SHA384 checksum for a file:
6 |
7 | `sha512sum {{filename1}}`
8 |
9 | - Calculate SHA384 checksums for multiple files:
10 |
11 | `sha512sum {{filename1}} {{filename2}}`
12 |
13 | - Read a file of SHA512 sums and verify all files have matching checksums:
14 |
15 | `sha512sum -c {{filename.sha512}}`
16 |
--------------------------------------------------------------------------------
/pages/common/dig.md:
--------------------------------------------------------------------------------
1 | # dig
2 |
3 | > DNS Lookup utility.
4 |
5 | - Lookup the IP(s) associated with a hostname (A records):
6 |
7 | `dig +short {{hostname.com}}`
8 |
9 | - Lookup the mail server associated with a given domain name (MX record):
10 |
11 | `dig +short {{hostname.com}} MX`
12 |
13 | - Specify an alternate DNS server to query (8.8.8.8 is google's public DNS):
14 |
15 | `dig @8.8.8.8 {{hostname.com}}`
16 |
--------------------------------------------------------------------------------
/pages/common/make.md:
--------------------------------------------------------------------------------
1 | # make
2 |
3 | > Task runner for rules described in Makefile.
4 | > Mostly used to control the compilation of an executable from source code.
5 |
6 | - Call the all rule:
7 |
8 | `make`
9 |
10 | - Call a specific rule:
11 |
12 | `make {{rule}}`
13 |
14 | - Use specific Makefile:
15 |
16 | `make -f {{file}}`
17 |
18 | - Execute make from another directory:
19 |
20 | `make -C {{directory}}`
21 |
--------------------------------------------------------------------------------
/pages/common/man.md:
--------------------------------------------------------------------------------
1 | # man
2 |
3 | > Format and display manual pages.
4 |
5 | - Display man page for a command:
6 |
7 | `man {{command}}`
8 |
9 | - Display path searched for manpages:
10 |
11 | `man --path`
12 |
13 | - Display location of a manpage rather than the manpage itself:
14 |
15 | `man -w {{command}}`
16 |
17 | - Do a keyword search for manpages containing a search string:
18 |
19 | `man -k {{keyword}}`
20 |
--------------------------------------------------------------------------------
/pages/common/traceroute.md:
--------------------------------------------------------------------------------
1 | # traceroute
2 |
3 | > Print the route packets trace to network host.
4 |
5 | - Traceroute to a host:
6 |
7 | `traceroute {{host}}`
8 |
9 | - Disable IP address and host name mapping:
10 |
11 | `traceroute -n {{host}}`
12 |
13 | - Specify wait time for response:
14 |
15 | `traceroute -w 0.5 {{host}}`
16 |
17 | - Specify number of queries per hop:
18 |
19 | `traceroute -q 5 {{host}}`
20 |
--------------------------------------------------------------------------------
/pages/linux/mke2fs.md:
--------------------------------------------------------------------------------
1 | # mke2fs
2 |
3 | > Creates a Linux filesystem inside a partition.
4 |
5 | - Create an ext2 filesystem in partition 1 of device b (`sdb1`):
6 |
7 | `mkfs.ext2 {{/dev/sdb1}}`
8 |
9 | - Create an ext3 filesystem in partition 1 of device b (`sdb1`):
10 |
11 | `mkfs.ext3 {{/dev/sdb1}}`
12 |
13 | - Create an ext3 filesystem in partition 1 of device b (`sdb1`):
14 |
15 | `mkfs.ext3 {{/dev/sdb1}}`
16 |
--------------------------------------------------------------------------------
/pages/linux/mkfs.exfat.md:
--------------------------------------------------------------------------------
1 | # mkfs.exfat
2 |
3 | > Creates an exfat filesystem inside a partition.
4 |
5 | - Create an exfat filesystem inside partition 1 on device b (`sdb1`):
6 |
7 | `mkfs.exfat {{/dev/sdb1}}`
8 |
9 | - Create filesystem with a volume-name:
10 |
11 | `mkfs.exfat -n {{volume-name}} {{/dev/sdb1}}`
12 |
13 | - Create filesystem with a volume-id:
14 |
15 | `mkfs.exfat -i {{volume-id}} {{/dev/sdb1}}`
16 |
--------------------------------------------------------------------------------
/pages/linux/pkginfo.md:
--------------------------------------------------------------------------------
1 | # pkginfo
2 |
3 | > Query the package database on a CRUX system.
4 |
5 | - List installed packages and their versions:
6 |
7 | `pkginfo -i`
8 |
9 | - List files owned by a package:
10 |
11 | `pkginfo -l {{package-name}}`
12 |
13 | - List the owner(s) of files matching a pattern:
14 |
15 | `pkginfo -o {{pattern}}`
16 |
17 | - Print the footprint of a file:
18 |
19 | `pkginfo -f {{file}}`
20 |
--------------------------------------------------------------------------------
/pages/osx/md5.md:
--------------------------------------------------------------------------------
1 | # md5
2 |
3 | > Calculate MD5 cryptographic checksums.
4 |
5 | - Calculate the MD5 checksum for a file:
6 |
7 | `md5 {{filename}}`
8 |
9 | - Calculate MD5 checksums for multiple files:
10 |
11 | `md5 {{filename1}} {{filename2}}`
12 |
13 | - Output only the md5 checksum (no filename):
14 |
15 | `md5 -q {{filename}}`
16 |
17 | - Print a checksum of the given string:
18 |
19 | `md5 -s {{string}}`
20 |
--------------------------------------------------------------------------------
/pages/sunos/prctl.md:
--------------------------------------------------------------------------------
1 | # prctl
2 |
3 | > Get or set the resource controls of running processes,.
4 | > Tasks, and projects.
5 |
6 | - Examine process limits and permissions:
7 |
8 | `prctl {{PID}}`
9 |
10 | - Examine process limits and permissions in machine parseable format:
11 |
12 | `prctl -P {{PID}}`
13 |
14 | - Get specific limit for a running process:
15 |
16 | `prctl -n process.max-file-descriptor {{PID}}`
17 |
--------------------------------------------------------------------------------
/pages/common/convmv.md:
--------------------------------------------------------------------------------
1 | # convmv
2 |
3 | > Convert filenames (NOT file content) from one encoding to another.
4 |
5 | - Test filename encoding conversion (don't actually change the filename):
6 |
7 | `convmv -f {{from_encoding}} -t {{to_encoding}} {{input_file}}`
8 |
9 | - Convert filename encoding and rename the file to the new enconding:
10 |
11 | `convmv -f {{from_encoding}} -t {{to_encoding}} --notest {{input_file}}`
12 |
--------------------------------------------------------------------------------
/pages/common/gifsicle.md:
--------------------------------------------------------------------------------
1 | # gifsicle
2 |
3 | > Create gifs.
4 |
5 | - Make a GIF animation with gifsicle:
6 |
7 | `gifsicle --delay={{10}} --loop *.gif > {{anim.gif}}`
8 |
9 | - Extract frames from an animation:
10 |
11 | `gifsicle {{anim.gif}} '#0' > {{firstframe.gif}}`
12 |
13 | - You can also edit animations by replacing, deleting, or inserting frames:
14 |
15 | `gifsicle -b {{anim.gif}} --replace '#0' {{new.gif}}`
16 |
--------------------------------------------------------------------------------
/pages/common/haxelib.md:
--------------------------------------------------------------------------------
1 | # haxelib
2 |
3 | > Haxe Library Manager.
4 |
5 | - Search for a Haxe library:
6 |
7 | `haxelib search {{keyword}}`
8 |
9 | - Install a Haxe library:
10 |
11 | `haxelib install {{libname}}`
12 |
13 | - Upgrade all installed Haxe libraries:
14 |
15 | `haxelib upgrade`
16 |
17 | - Install the development version of a library from a Git repository:
18 |
19 | `haxelib git {{libname}} {{GIT-URL}}`
20 |
--------------------------------------------------------------------------------
/pages/common/hn.md:
--------------------------------------------------------------------------------
1 | # hn
2 |
3 | > Command-line interface for Hacker News.
4 |
5 | - View stories on Hacker News:
6 |
7 | `hn`
8 |
9 | - View _number_ of stories on Hacker News:
10 |
11 | `hn --limit {{number}}`
12 |
13 | - View stories on Hacker News, and keep the list open after selecting a link:
14 |
15 | `hn --keep-open`
16 |
17 | - View stories on Hacker News sorted by submission date:
18 |
19 | `hn --latest`
20 |
--------------------------------------------------------------------------------
/pages/common/hub.md:
--------------------------------------------------------------------------------
1 | # hub
2 |
3 | > A command-line wrapper for git that makes you better at GitHub.
4 | > The commands can also be used using "git" instead of "hub".
5 |
6 | - Clone a repository you own:
7 |
8 | `hub clone {{repo_name}}`
9 |
10 | - Clone another user repository:
11 |
12 | `hub clone {{github_username}}/{{repo_name}}`
13 |
14 | - Open the current project's issues page:
15 |
16 | `hub browse -- issues`
17 |
--------------------------------------------------------------------------------
/pages/common/pgrep.md:
--------------------------------------------------------------------------------
1 | # pgrep
2 |
3 | > Find or signal process by name.
4 |
5 | - Return PIDs of any running processes with a matching command string:
6 |
7 | `pgrep {{process_name}}`
8 |
9 | - Search full command line with parameters instead of just the process name:
10 |
11 | `pgrep -f "{{process_name}} {{parameter}}"`
12 |
13 | - Search for process run by a specific user:
14 |
15 | `pgrep -u root {{process_name}}`
16 |
--------------------------------------------------------------------------------
/pages/common/pkill.md:
--------------------------------------------------------------------------------
1 | # pkill
2 |
3 | > Signal process by name.
4 | > Mostly used for stopping processes.
5 |
6 | - Kill all processes which match:
7 |
8 | `pkill -9 {{process_name}}`
9 |
10 | - Kill all processes which match their full command instead of just the process name:
11 |
12 | `pkill -9 -f "{{command_name}}"`
13 |
14 | - Send SIGUSR1 signal to processes which match:
15 |
16 | `pkill -USR1 {{process_name}}`
17 |
--------------------------------------------------------------------------------
/pages/common/sudo.md:
--------------------------------------------------------------------------------
1 | # sudo
2 |
3 | > Execute a command as another user.
4 |
5 | - List of an unreadable directory:
6 |
7 | `sudo {{ls}} {{/usr/local/scrt}}`
8 |
9 | - To edit a file as user www:
10 |
11 | `sudo -u {{www}} {{vi}} {{/var/www/index.html}}`
12 |
13 | - To shutdown the machine:
14 |
15 | `sudo {{shutdown}} -r +10 {{"Cya soon!"}}`
16 |
17 | - To repeat the last command as sudo:
18 |
19 | `sudo {{!!}}`
20 |
--------------------------------------------------------------------------------
/pages/common/zsh.md:
--------------------------------------------------------------------------------
1 | # zsh
2 |
3 | > Z SHell.
4 | > `bash` and `sh`-compatible command line interpreter.
5 |
6 | - Start interactive command line interpreter:
7 |
8 | `zsh`
9 |
10 | - Execute command passed as parameter:
11 |
12 | `zsh -c {{command}}`
13 |
14 | - Run commands from file (script):
15 |
16 | `zsh {{file}}`
17 |
18 | - Run commands from file and print them as they are executed:
19 |
20 | `zsh -x {{file}}`
21 |
--------------------------------------------------------------------------------
/pages/linux/nethogs.md:
--------------------------------------------------------------------------------
1 | # nethogs
2 |
3 | > Monitor bandwidth usage per process.
4 |
5 | - Start nethogs as root (default device is eth0):
6 |
7 | `sudo nethogs`
8 |
9 | - Monitor bandwidth on specific device:
10 |
11 | `sudo nethogs {{device}}`
12 |
13 | - Monitor bandwidth on multiple devices:
14 |
15 | `sudo nethogs {{device1}} {{device2}}`
16 |
17 | - Specify refresh rate:
18 |
19 | `sudo nethogs -t {{seconds}}`
20 |
--------------------------------------------------------------------------------
/pages/linux/nm.md:
--------------------------------------------------------------------------------
1 | # nm
2 |
3 | > List symbol names in object files.
4 |
5 | - List global (extern) functions in a file (prefixed with T):
6 |
7 | `nm -g {{file.o}}`
8 |
9 | - Demangle C++ symbols (make them readable):
10 |
11 | `nm --demangle {{file.o}}`
12 |
13 | - List only undefined symbols in a file:
14 |
15 | `nm -u {{file.o}}`
16 |
17 | - List all symbols, even debugging symbols:
18 |
19 | `nm -a {{file.o}}`
20 |
--------------------------------------------------------------------------------
/pages/osx/xsltproc.md:
--------------------------------------------------------------------------------
1 | # xsltproc
2 |
3 | > Transform XML with XSLT to produce output (usually HTML or XML).
4 |
5 | - Transform an XML file with a specific XSLT stylesheet:
6 |
7 | `xsltproc --output {{output.html}} {{stylesheet.xslt}} {{xmlfile.xml}}`
8 |
9 | - Pass a value to a parameter in the stylesheet:
10 |
11 | `xsltproc --output {{output.html}} --stringparam {{name}} {{value}} {{stylesheet.xslt}} {{xmlfile.xml}}`
12 |
--------------------------------------------------------------------------------
/pages/common/jhat.md:
--------------------------------------------------------------------------------
1 | # jhat
2 |
3 | > Java Heap Analysis Tool.
4 |
5 | - Analyze a heap dump (from jmap), view via http on port 7000:
6 |
7 | `jhat {{dump_file.bin}}`
8 |
9 | - Analyze a heap dump, specifying an alternate port for the http server:
10 |
11 | `jhat -p {{port}} {{dump_file.bin}}`
12 |
13 | - Analyze a dump letting jhat use up to 8GB RAM (2-4x dump size recommended):
14 |
15 | `jhat -J-mx8G {{dump_file.bin}}`
16 |
--------------------------------------------------------------------------------
/pages/common/lpstat.md:
--------------------------------------------------------------------------------
1 | # lpstat
2 |
3 | > Show status information about printers.
4 |
5 | - List printers present on the machine and whether they are enabled for printing:
6 |
7 | `lpstat -p`
8 |
9 | - Show the default printer:
10 |
11 | `lpstat -d`
12 |
13 | - Display all available status information:
14 |
15 | `lpstat -t`
16 |
17 | - Show a list of print jobs queued by the specified user:
18 |
19 | `lpstat -u {{user}}`
20 |
--------------------------------------------------------------------------------
/pages/common/python.md:
--------------------------------------------------------------------------------
1 | # Python
2 |
3 | > Python language interpreter.
4 |
5 | - Call a Python interactive shell (REPL):
6 |
7 | `python`
8 |
9 | - Execute script in a given Python file:
10 |
11 | `python {{script.py}}`
12 |
13 | - Execute Python language single command:
14 |
15 | `python -c {{command}}`
16 |
17 | - Run library module as a script (terminates option list):
18 |
19 | `python -m {{module}} {{arguments}}`
20 |
--------------------------------------------------------------------------------
/pages/common/rm.md:
--------------------------------------------------------------------------------
1 | # rm
2 |
3 | > Remove files or directories.
4 |
5 | - Remove files from arbitrary locations:
6 |
7 | `rm {{/path/to/file}} {{/otherpath/to/file2}}`
8 |
9 | - Remove recursively a directory and all its subdirectories:
10 |
11 | `rm -r {{/path/to/folder}}`
12 |
13 | - Remove directory without prompt:
14 |
15 | `rm -rf {{/path/to/folder}}`
16 |
17 | - Prompt before every removal:
18 |
19 | `rm -i {{\*}}`
20 |
--------------------------------------------------------------------------------
/pages/linux/findmnt.md:
--------------------------------------------------------------------------------
1 | # findmnt
2 |
3 | > Find your filesystem.
4 |
5 | - List all mounted filesystems:
6 |
7 | `findmnt`
8 |
9 | - Search for a device:
10 |
11 | `findmnt {{/dev/sdb1}}`
12 |
13 | - Search for a mountpoint:
14 |
15 | `findmnt {{/}}`
16 |
17 | - Find filesystems in specific type:
18 |
19 | `findmnt -t {{ext4}}`
20 |
21 | - Find filesystems with specific label:
22 |
23 | `findmnt LABEL={{BigStorage}}`
24 |
--------------------------------------------------------------------------------
/pages/sunos/svcs.md:
--------------------------------------------------------------------------------
1 | # svcs
2 |
3 | > List information about running services.
4 |
5 | - List all running services:
6 |
7 | `svcs`
8 |
9 | - List services that are not running:
10 |
11 | `svcs -vx`
12 |
13 | - List information about a service:
14 |
15 | `svcs apache`
16 |
17 | - Show location of service log file:
18 |
19 | `svcs -L apache`
20 |
21 | - Display end of a service log file:
22 |
23 | `tail $(svcs -L apache)`
24 |
--------------------------------------------------------------------------------
/pages/common/iconv.md:
--------------------------------------------------------------------------------
1 | # iconv
2 |
3 | > Converts text from one encoding to another.
4 |
5 | - Convert file to a specific encoding, and print to stdout:
6 |
7 | `iconv -f {{from_encoding}} -t {{to_encoding}} {{input_file}}`
8 |
9 | - Convert file to the current locale's encoding, and output to a file:
10 |
11 | `iconv -f {{from_encoding}} {{input_file}} > {{output_file}}`
12 |
13 | - List supported encodings:
14 |
15 | `iconv -l`
16 |
--------------------------------------------------------------------------------
/pages/linux/at.md:
--------------------------------------------------------------------------------
1 | # at
2 |
3 | > Executes commands at a specified time.
4 |
5 | - Open an `at` prompt to create a new set of scheduled commands, press Ctrl+D to save and exit:
6 |
7 | `at {{hh:mm:ss}}`
8 |
9 | - Execute the commands and email the result using a local mailing program such as sendmail:
10 |
11 | `at {{hh:mm:ss}} -m`
12 |
13 | - Execute a script at the given time:
14 |
15 | `at {{hh:mm:ss}} -f {{path/to/file}}`
16 |
--------------------------------------------------------------------------------
/pages/linux/shutdown.md:
--------------------------------------------------------------------------------
1 | # shutdown
2 |
3 | > Shutdown and reboot the system.
4 |
5 | - Power off (halt) immediately:
6 |
7 | `shutdown -h now`
8 |
9 | - Reboot immediately:
10 |
11 | `shutdown -r now`
12 |
13 | - Reboot in 5 minutes:
14 |
15 | `shutdown -r +{{5}} &`
16 |
17 | - Shutdown at 1:00 pm (Uses 24h clock):
18 |
19 | `shutdown -h 13:00`
20 |
21 | - Cancel a pending shutdown/reboot operation:
22 |
23 | `shutdown -c`
24 |
--------------------------------------------------------------------------------
/pages/osx/archey.md:
--------------------------------------------------------------------------------
1 | # archey
2 |
3 | > Simple tool for stylishly displaying system information.
4 |
5 | - Show system information:
6 |
7 | `archey`
8 |
9 | - Show system information without colored output:
10 |
11 | `archey --nocolor`
12 |
13 | - Show system information, using MacPorts instead of Homebrew:
14 |
15 | `archey --macports`
16 |
17 | - Show system information without IP address check:
18 |
19 | `archey --offline`
20 |
--------------------------------------------------------------------------------
/pages/common/git-add.md:
--------------------------------------------------------------------------------
1 | # git add
2 |
3 | > Adds changed files to the index.
4 |
5 | - Add a file to the index:
6 |
7 | `git add {{path/to/file}}`
8 |
9 | - Add all files (tracked and untracked):
10 |
11 | `git add .`
12 |
13 | - Only add already tracked files:
14 |
15 | `git add -u`
16 |
17 | - Also add ignored files:
18 |
19 | `git add -f`
20 |
21 | - Add parts of a file interactively:
22 |
23 | `git add -p {{path/to/file}}`
24 |
--------------------------------------------------------------------------------
/pages/common/split.md:
--------------------------------------------------------------------------------
1 | # split
2 |
3 | > Split a file into pieces.
4 |
5 | - Split a file, each split having 10 lines (except the last split):
6 |
7 | `split -l 10 {{filename}}`
8 |
9 | - Split a file into 5 files. File is split such that each split has same size (except the last split):
10 |
11 | `split -n 5 {{filename}}`
12 |
13 | - Split a file with at most 512 bytes of lines in each split:
14 |
15 | `split -C 512 {{filename}}`
16 |
--------------------------------------------------------------------------------
/pages/common/cat.md:
--------------------------------------------------------------------------------
1 | # cat
2 |
3 | > Print and concatenate files.
4 |
5 | - Print the contents of a file to the standard output:
6 |
7 | `cat {{file}}`
8 |
9 | - Concatenate several files into the target file:
10 |
11 | `cat {{file1}} {{file2}} > {{target-file}}`
12 |
13 | - Append several files into the target file:
14 |
15 | `cat {{file1}} {{file2}} >> {{target-file}}`
16 |
17 | - Number all output lines:
18 |
19 | `cat -n {{file}}`
20 |
--------------------------------------------------------------------------------
/pages/common/git-mv.md:
--------------------------------------------------------------------------------
1 | # git mv
2 |
3 | > Move or rename files and update the git index.
4 |
5 | - Move file inside the repo and add the movement to the next commit:
6 |
7 | `git mv {{path/to/file}} {{new/path/to/file}}`
8 |
9 | - Rename file and add renaming to the next commit:
10 |
11 | `git mv {{filename}} {{new_filename}}`
12 |
13 | - Overwrite the file in the target path if it exists:
14 |
15 | `git mv --force {{file}} {{target}}`
16 |
--------------------------------------------------------------------------------
/pages/common/vim.md:
--------------------------------------------------------------------------------
1 | # vim
2 |
3 | > Vi IMproved, a programmer's text editor.
4 |
5 | - Open a file with cursor at the given line number:
6 |
7 | `vim {{file}} +{{linenumber}}`
8 |
9 | - Open multiple files at once, each file in it's own tab page:
10 |
11 | `vim -p {{file1}} {{file2}} {{file3}}`
12 |
13 | - Open a file in read-only mode:
14 |
15 | `view {{file}}`
16 |
17 | - Exit vim:
18 |
19 | `[Esc] (to switch to normal mode), then :q`
20 |
--------------------------------------------------------------------------------
/pages/linux/getent.md:
--------------------------------------------------------------------------------
1 | # getent
2 |
3 | > Get entries from Name Service Switch libraries.
4 |
5 | - Get list of all groups:
6 |
7 | `getent group`
8 |
9 | - See the members of a group:
10 |
11 | `getenet group {{group_name}}`
12 |
13 | - Get list of all services:
14 |
15 | `getent services`
16 |
17 | - Find a username by UID:
18 |
19 | `getent passwd 1000`
20 |
21 | - Perform a reverse DNS lookup:
22 |
23 | `getent hosts {{host}}`
24 |
--------------------------------------------------------------------------------
/pages/linux/ufw.md:
--------------------------------------------------------------------------------
1 | # ufw
2 |
3 | > Uncomplicated Firewall.
4 | > Frontend for iptables aiming to make configuration of a firewall easier.
5 |
6 | - Enable ufw:
7 |
8 | `ufw enable`
9 |
10 | - Disable ufw:
11 |
12 | `ufw disable`
13 |
14 | - Add ufw allow rule:
15 |
16 | `ufw allow {{port}} {{service_name}}`
17 |
18 | - Add ufw deny rule:
19 |
20 | `ufw deny {{port}} {{service_name}}`
21 |
22 | - Show ufw rules:
23 |
24 | `ufw status`
25 |
--------------------------------------------------------------------------------
/pages/linux/useradd.md:
--------------------------------------------------------------------------------
1 | # useradd
2 |
3 | > Create a new user.
4 |
5 | - Create new user:
6 |
7 | `useradd {{name}}`
8 |
9 | - Create new user with a default home directory:
10 |
11 | `useradd -m {{name}}`
12 |
13 | - Create new user with specified shell:
14 |
15 | `useradd -s {{/path/to/shell}} {{name}}`
16 |
17 | - Create new user with supplementary groups (mind the lack of whitespace):
18 |
19 | `useradd -G {{group1,group2}} {{name}}`
20 |
--------------------------------------------------------------------------------
/pages/common/ack.md:
--------------------------------------------------------------------------------
1 | # ack
2 |
3 | > A search tool like grep, optimized for programmers.
4 |
5 | - Find files containing "foo":
6 |
7 | `ack {{foo}}`
8 |
9 | - Find files in a specific language:
10 |
11 | `ack --ruby {{each_with_object}}`
12 |
13 | - Count the total number of matches for the term "foo":
14 |
15 | `ack -ch {{foo}}`
16 |
17 | - Show the file names containing "foo" and number of matches in each file:
18 |
19 | `ack -cl {{foo}}`
20 |
--------------------------------------------------------------------------------
/pages/common/who.md:
--------------------------------------------------------------------------------
1 | # who
2 |
3 | > Display who is logged in and related data (processes, boot time).
4 |
5 | - Display the username, line, and time of all currently logged-in sessions:
6 |
7 | `who`
8 |
9 | - Display information only for the current terminal session:
10 |
11 | `who am i`
12 |
13 | - Display all available information:
14 |
15 | `who -a`
16 |
17 | - Display all available information with table headers:
18 |
19 | `who -a -H`
20 |
--------------------------------------------------------------------------------
/pages/linux/dpkg-query.md:
--------------------------------------------------------------------------------
1 | # dpkg-query
2 |
3 | > A tool that shows information about installed packages.
4 |
5 | - List all installed packages:
6 |
7 | `dpkg-query -l`
8 |
9 | - List installed packages matching a pattern:
10 |
11 | `dpkg-query -l '{{pattern}}'`
12 |
13 | - List all files installed by a package:
14 |
15 | `dpkg-query -L {{package_name}}`
16 |
17 | - Show information about a package:
18 |
19 | `dpkg-query -s {{package_name}}`
20 |
--------------------------------------------------------------------------------
/pages/linux/hwclock.md:
--------------------------------------------------------------------------------
1 | # hwclock
2 |
3 | > Used for reading or changing the hardware clock. Usually requires root.
4 |
5 | - Display the current time as reported by the hardware clock:
6 |
7 | `hwclock`
8 |
9 | - Write the current software clock time to the hardware clock (sometimes used during system setup):
10 |
11 | `hwclock --systohc`
12 |
13 | - Write the current hardware clock time to the software clock:
14 |
15 | `hwclock --hctosys`
16 |
--------------------------------------------------------------------------------
/pages/linux/shuf.md:
--------------------------------------------------------------------------------
1 | # shuf
2 |
3 | > Generate random permutations.
4 |
5 | - Randomize the order of lines in a file and output the result:
6 |
7 | `shuf {{filename}}`
8 |
9 | - Only output the first n entries of the result:
10 |
11 | `shuf -n {{n}} {{filename}}`
12 |
13 | - Write output to another file:
14 |
15 | `shuf -o {{another_filename}} {{filename}}`
16 |
17 | - Generate random numbers in range:
18 |
19 | `shuf -i {{low}}-{{high}}`
20 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .tags*
3 | /.idea/
4 | /build/
5 | /dist/
6 | /external_binaries/
7 | /out/
8 | /vendor/brightray/vendor/download/
9 | /vendor/debian_wheezy_amd64-sysroot/
10 | /vendor/debian_wheezy_arm-sysroot/
11 | /vendor/debian_wheezy_i386-sysroot/
12 | /vendor/python_26/
13 | /vendor/npm/
14 | /vendor/llvm/
15 | /vendor/llvm-build/
16 | /vendor/.gclient
17 | node_modules/
18 | *.xcodeproj
19 | *.swp
20 | *.pyc
21 | debug.log
22 | npm-debug.log
--------------------------------------------------------------------------------
/pages/linux/hostname.md:
--------------------------------------------------------------------------------
1 | # hostname
2 |
3 | > Show or set the system's host name.
4 |
5 | - Show current host name:
6 |
7 | `hostname`
8 |
9 | - Show the network address of the host name:
10 |
11 | `hostname -i`
12 |
13 | - Show all network addresses of the host:
14 |
15 | `hostname -I`
16 |
17 | - Show the FQDN (Fully Qualified Domain Name):
18 |
19 | `hostname --fqdn`
20 |
21 | - Set current host name:
22 |
23 | `hostname {{new_hostname}}`
24 |
--------------------------------------------------------------------------------
/pages/common/espeak.md:
--------------------------------------------------------------------------------
1 | # espeak
2 |
3 | > Uses text-to-speech to speak through the default sound device.
4 |
5 | - Speak a phrase aloud:
6 |
7 | `espeak "I like to ride my bike."`
8 |
9 | - Speak a file aloud:
10 |
11 | `espeak -f {{filename}}`
12 |
13 | - Save output to a WAV audio file, rather than speaking it directly:
14 |
15 | `espeak -w {{filename.wav}} "It's GNU plus Linux"`
16 |
17 | - Use a different voice:
18 |
19 | `espeak -v {{voice}}`
20 |
--------------------------------------------------------------------------------
/pages/common/fdupes.md:
--------------------------------------------------------------------------------
1 | # fdupes
2 |
3 | > Finds duplicate files in a given.
4 | > Set of directories.
5 |
6 | - Search a single directory:
7 |
8 | `fdupes {{directory}}`
9 |
10 | - Search multiple directories:
11 |
12 | `fdupes {{directory1}} {{directory2}}`
13 |
14 | - Search all directories recursively:
15 |
16 | `fdupes -r {{directory}}`
17 |
18 | - Search multiple directories, one recursively:
19 |
20 | `fdupes {{directory1}} -R {{directory2}}`
21 |
--------------------------------------------------------------------------------
/pages/common/gem.md:
--------------------------------------------------------------------------------
1 | # gem
2 |
3 | > Interact with the package manager for the Ruby programming language.
4 |
5 | - Install latest version of a gem:
6 |
7 | `gem install {{gemname}}`
8 |
9 | - Install specific version of a gem:
10 |
11 | `gem install {{gemname}} -v {{1.0.0}}`
12 |
13 | - Update a gem:
14 |
15 | `gem update {{gemname}}`
16 |
17 | - List all gems:
18 |
19 | `gem list`
20 |
21 | - Uninstall a gem:
22 |
23 | `gem uninstall {{gemname}}`
24 |
--------------------------------------------------------------------------------
/pages/common/ioping.md:
--------------------------------------------------------------------------------
1 | # ioping
2 |
3 | > Monitor I/O latency in real time.
4 |
5 | - Show disk I/O latency using the default values and the current directory:
6 |
7 | `ioping .`
8 |
9 | - Measure latency on /tmp using 10 requests of 1 megabyte each:
10 |
11 | `ioping -c 10 -s 1M /tmp`
12 |
13 | - Measure disk seek rate on /dev/sda:
14 |
15 | `ioping -R /dev/sda`
16 |
17 | - Measure disk sequential speed on /dev/sda:
18 |
19 | `ioping -RL /dev/sda`
20 |
--------------------------------------------------------------------------------
/pages/linux/screenfetch.md:
--------------------------------------------------------------------------------
1 | # screenfetch
2 |
3 | > Display system information.
4 |
5 | - Start screenfetch:
6 |
7 | `screenfetch`
8 |
9 | - Take a screenshot (requires 'scrot'):
10 |
11 | `screenfetch -s`
12 |
13 | - Specify distribution logo:
14 |
15 | `screenfetch -A '{{distribution_name}}'`
16 |
17 | - Specify distribution logo and text:
18 |
19 | `screenfetch -D '{{distribution_name}}'`
20 |
21 | - Strip all color:
22 |
23 | `screenfetch -N`
24 |
--------------------------------------------------------------------------------
/pages/common/touch.md:
--------------------------------------------------------------------------------
1 | # touch
2 |
3 | > Change a file access and modification times (atime, mtime).
4 |
5 | - Create a new empty file(s) or change the times for existing file(s) to current time:
6 |
7 | `touch {{filename}}`
8 |
9 | - Set the times on a file to a specific date and time:
10 |
11 | `touch -t {{YYYYMMDDHHMM.SS}} {{filename}}`
12 |
13 | - Use the times from a file to set the times on a second file:
14 |
15 | `touch -r {{filename}} {{filename2}}`
16 |
--------------------------------------------------------------------------------
/pages/common/git-pull.md:
--------------------------------------------------------------------------------
1 | # git pull
2 |
3 | > Fetch branch from a remote repository and merge it to local repository.
4 |
5 | - Download changes from default remote repository and merge it:
6 |
7 | `git pull`
8 |
9 | - Download changes from default remote repository and use fast forward:
10 |
11 | `git pull --rebase`
12 |
13 | - Download changes from given remote repository and branch, then merge them into HEAD:
14 |
15 | `git pull {{remote_name}} {{branch}}`
16 |
--------------------------------------------------------------------------------
/pages/common/mitmdump.md:
--------------------------------------------------------------------------------
1 | # mitmdump
2 |
3 | > View, record, and programmatically transform HTTP traffic.
4 | > The command-line counterpart to mitmproxy.
5 |
6 | - Start a proxy and save all output to a file:
7 |
8 | `mitmdump -w {{filename}}`
9 |
10 | - Filter a saved traffic file to just POST requests:
11 |
12 | `mitmdump -nr {{input_filename}} -w {{output_filename}} {{"~m post"}}`
13 |
14 | - Replay a saved traffic file:
15 |
16 | `mitmdump -nc {{filename}}`
17 |
--------------------------------------------------------------------------------
/pages/osx/diskutil.md:
--------------------------------------------------------------------------------
1 | # diskutil
2 |
3 | > Utility to manage local disks and volumes.
4 |
5 | - List all currently available disks, partitions and mounted volumes:
6 |
7 | `diskutil list`
8 |
9 | - Repair the file system data structures of a volume:
10 |
11 | `diskutil repairVolume {{/dev/diskX}}`
12 |
13 | - Unmount a volume:
14 |
15 | `diskutil unmountDisk {{/dev/diskX}}`
16 |
17 | - Eject a CD/DVD (unmount first):
18 |
19 | `diskutil eject {{/dev/disk1}}`
20 |
--------------------------------------------------------------------------------
/pages/common/alias.md:
--------------------------------------------------------------------------------
1 | # alias
2 |
3 | > Creates an alias for a word when used.
4 | > As the first word of a command.
5 |
6 | - Create a generic alias:
7 |
8 | `alias {{word}}="{{command}}"`
9 |
10 | - Remove an aliased command:
11 |
12 | `unalias {{word}}`
13 |
14 | - Full list of aliased words:
15 |
16 | `alias -p`
17 |
18 | - Turn rm an interative command:
19 |
20 | `alias {{rm}}="{{rm -i}}"`
21 |
22 | - Override la as ls -a:
23 |
24 | `alias {{la}}="{{ls -a}}"`
25 |
--------------------------------------------------------------------------------
/pages/common/bashmarks.md:
--------------------------------------------------------------------------------
1 | # bashmarks
2 |
3 | > Save and jump to commonly used directories using 1 character commands.
4 |
5 | - List available bookmarks:
6 |
7 | `l`
8 |
9 | - Save the current folder as "bookmark_name":
10 |
11 | `s {{bookmark_name}}`
12 |
13 | - Go to a bookmarked folder:
14 |
15 | `g {{bookmark_name}}`
16 |
17 | - Print a bookmarked folder's contents:
18 |
19 | `p {{bookmark_name}}`
20 |
21 | - Delete a bookmark:
22 |
23 | `d {{bookmark_name}}`
24 |
--------------------------------------------------------------------------------
/pages/common/cal.md:
--------------------------------------------------------------------------------
1 | # cal
2 |
3 | > Prints calendar information.
4 |
5 | - Display a calendar for the current month:
6 |
7 | `cal`
8 |
9 | - Display a calendar for a specific month:
10 |
11 | `cal -m {{month_number}}`
12 |
13 | - Display a 12 month calendar for the current year:
14 |
15 | `cal -y`
16 |
17 | - Display a 12 month calendar for a specific year:
18 |
19 | `cal 2016`
20 |
21 | - Display date of Easter (western churches):
22 |
23 | `ncal -e {{year}}`
24 |
--------------------------------------------------------------------------------
/pages/common/passwd.md:
--------------------------------------------------------------------------------
1 | # passwd
2 |
3 | > Passwd is a tool used to change a user's password.
4 |
5 | - Change the password of the current user:
6 |
7 | `passwd {{new password}}`
8 |
9 | - Change the password of the specified user:
10 |
11 | `passwd {{username}} {{new password}}`
12 |
13 | - Get the current status of the user:
14 |
15 | `passwd -S`
16 |
17 | - Make the password of the account blank (it will set the named account passwordless):
18 |
19 | `passwd -d`
20 |
--------------------------------------------------------------------------------
/pages/common/ping.md:
--------------------------------------------------------------------------------
1 | # ping
2 |
3 | > Send ICMP ECHO_REQUEST packets to network hosts.
4 |
5 | - Ping host:
6 |
7 | `ping {{host}}`
8 |
9 | - Ping a host only a specific number of times:
10 |
11 | `ping -c {{count}} {{host}}`
12 |
13 | - Ping host, specifying the interval in seconds between requests (default is 1 second):
14 |
15 | `ping -i {{seconds}} {{host}}`
16 |
17 | - Ping host without trying to lookup symbolic names for addresses:
18 |
19 | `ping -n {{host}}`
20 |
--------------------------------------------------------------------------------
/pages/common/sails.md:
--------------------------------------------------------------------------------
1 | # sails
2 |
3 | > Sails.js is a realtime enterprise level MVC framework built on top of Node.js.
4 |
5 | - Start Sails:
6 |
7 | `sails lift`
8 |
9 | - Create new Sails project:
10 |
11 | `sails new {{projectName}}`
12 |
13 | - Generate Sails API:
14 |
15 | `sails generate {{name}}`
16 |
17 | - Generate Sails Controller:
18 |
19 | `sails generate controller {{name}}`
20 |
21 | - Generate Sails Model:
22 |
23 | `sails generate model {{name}}`
24 |
--------------------------------------------------------------------------------
/pages/common/socat.md:
--------------------------------------------------------------------------------
1 | # socat
2 |
3 | > Multipurpose relay (SOcket CAT).
4 |
5 | - Listen to a port, wait for an incoming connection and transfer data to STDIO:
6 |
7 | `socat - TCP-LISTEN:8080,fork`
8 |
9 | - Create a connection to a host and port, transfer data in STDIO to connected host:
10 |
11 | `socat - TCP4:www.domain.com:80`
12 |
13 | - Forward incoming data of a local port to another host and port:
14 |
15 | `socat TCP-LISTEN:80,fork TCP4:www.domain.com:80`
16 |
--------------------------------------------------------------------------------
/pages/osx/netstat.md:
--------------------------------------------------------------------------------
1 | # netstat
2 |
3 | > Displays various networks related information such as open connections, open socket ports etc.
4 |
5 | - List all ports:
6 |
7 | `netstat -a`
8 |
9 | - List all listening ports:
10 |
11 | `netstat -l`
12 |
13 | - List listening TCP ports:
14 |
15 | `netstat -t`
16 |
17 | - Display PID and program names for a specific port:
18 |
19 | `netstat -p {PROTOCOL}`
20 |
21 | - List information continuously:
22 |
23 | `netstat -c`
24 |
--------------------------------------------------------------------------------
/pages/common/git-clone.md:
--------------------------------------------------------------------------------
1 | # git clone
2 |
3 | > Clone an existing repository.
4 |
5 | - Clone an existing repository:
6 |
7 | `git clone {{REMOTE-REPOSITORY-LOCATION}}`
8 |
9 | - For cloning from the local machine:
10 |
11 | `git clone -l`
12 |
13 | - Do it quietly:
14 |
15 | `git clone -q`
16 |
17 | - Clone an existing repository, and truncate to the specified number of revisions, save your time mostly:
18 |
19 | `git clone --depth 10 {{REMOTE-REPOSITORY-LOCATION}}`
20 |
--------------------------------------------------------------------------------
/pages/common/git-tag.md:
--------------------------------------------------------------------------------
1 | # git tag
2 |
3 | > Create, list, delete or verify tags.
4 | > Tag is reference to specific commit.
5 |
6 | - List all tags:
7 |
8 | `git tag`
9 |
10 | - Create a tag with the given name pointing to the current commit:
11 |
12 | `git tag {{tag_name}}`
13 |
14 | - Create an annotated tag with the given message:
15 |
16 | `git tag {{tag_name}} -m {{tag_message}}`
17 |
18 | - Delete the tag with the given name:
19 |
20 | `git tag -d {{tag_name}}`
21 |
--------------------------------------------------------------------------------
/pages/common/license.md:
--------------------------------------------------------------------------------
1 | # license
2 |
3 | > Create license files for open-source projects.
4 |
5 | - Create a license:
6 |
7 | `license {{license_name}}`
8 |
9 | - Create a license with custom filename:
10 |
11 | `license -o {{filename.txt}} {{license_name}}`
12 |
13 | - List all locally available licenses:
14 |
15 | `license ls`
16 |
17 | - Create a license with explicitly-set name and year:
18 |
19 | `license --name {{author}} --year {{release_year}} {{license_name}}`
20 |
--------------------------------------------------------------------------------
/pages/common/php.md:
--------------------------------------------------------------------------------
1 | # php
2 |
3 | > PHP Command Line Interface 'CLI'.
4 |
5 | - Parse and execute a file:
6 |
7 | `php {{file}}`
8 |
9 | - Check syntax (lint):
10 |
11 | `php -l {{file}}`
12 |
13 | - Run PHP interactively:
14 |
15 | `php -a`
16 |
17 | - Run PHP code. Notes: a) Don't use ?> tags; b) Escape double quotes with backslash:
18 |
19 | `php -r "{{code}}"`
20 |
21 | - Start a PHP built-in web server in the current directory:
22 |
23 | `php -S {{host:port}}`
24 |
--------------------------------------------------------------------------------
/pages/common/phpunit.md:
--------------------------------------------------------------------------------
1 | # phpunit
2 |
3 | > PHPUnit command-line test runner.
4 |
5 | - Run tests in the current direcotry. Note: Expects you to have a 'phpunit.xml':
6 |
7 | `phpunit`
8 |
9 | - Run tests in a specific file:
10 |
11 | `phpunit {{path/to/TestFile.php}}`
12 |
13 | - Run tests annotated with the given group:
14 |
15 | `phpunit --group {{name}}`
16 |
17 | - Run tests and generate a coverage report in HTML:
18 |
19 | `phpunit --coverage-html {{directory}}`
20 |
--------------------------------------------------------------------------------
/pages/linux/apt-key.md:
--------------------------------------------------------------------------------
1 | # apt-key
2 |
3 | > Key management utility for the APT Package Manager on Debian and Ubuntu.
4 |
5 | - List trusted keys:
6 |
7 | `apt-key list`
8 |
9 | - Add a key to the trusted keystore:
10 |
11 | `apt-key add {{public_key_file.asc}}`
12 |
13 | - Delete a key from the trusted keystore:
14 |
15 | `apt-key del {{key_id}}`
16 |
17 | - Add a remote key to the trusted keystore:
18 |
19 | `wget -qO - {{https://host.tld/filename.key}} | apt-key add -`
20 |
--------------------------------------------------------------------------------
/pages/linux/cryptsetup.md:
--------------------------------------------------------------------------------
1 | # cryptsetup
2 |
3 | > Manage plain dm-crypt and LUKS (Linux Unified Key Setup) encrypted volumes.
4 |
5 | - Initialize a LUKS volume (overwrites all data on the partition):
6 |
7 | `cryptsetup luksFormat {{/dev/sda1}}`
8 |
9 | - Open a LUKS volume and create a decrypted mapping at /dev/mapper/{{target}}:
10 |
11 | `cryptsetup luksOpen {{/dev/sda1}} {{target}}`
12 |
13 | - Remove an existing mapping:
14 |
15 | `cryptsetup luksClose {{target}}`
16 |
--------------------------------------------------------------------------------
/pages/common/mp4box.md:
--------------------------------------------------------------------------------
1 | # MP4Box
2 |
3 | > MPEG-4 Systems Toolbox - Muxes streams into MP4 container.
4 |
5 | - Display information about an existing MP4 file:
6 |
7 | `MP4Box -info {{filename}}`
8 |
9 | - Add an SRT subtitle file into an MP4 file:
10 |
11 | `MP4Box -add {{input-subs.srt}}:lang=eng -add {{input.mp4}} {{output.mp4}}`
12 |
13 | - Combine audio from one file and video from another:
14 |
15 | `MP4Box -add {{input1.mp4}}#audio -add {{input2.mp4}}#video {{output.mp4}`
16 |
--------------------------------------------------------------------------------
/pages/common/glances.md:
--------------------------------------------------------------------------------
1 | # glances
2 |
3 | > A cross-platform system monitoring tool.
4 |
5 | - Run in terminal:
6 |
7 | `glances`
8 |
9 | - Run in web server mode to show results in browser:
10 |
11 | `glances -w`
12 |
13 | - Run in server mode to allow connections from other Glances clients:
14 |
15 | `glances -s`
16 |
17 | - Connect to a Glances server:
18 |
19 | `glances -c {{hostname}}`
20 |
21 | - Require a password in (web) server mode:
22 |
23 | `glances -s --password`
24 |
--------------------------------------------------------------------------------
/pages/common/salt-key.md:
--------------------------------------------------------------------------------
1 | # salt-key
2 |
3 | > Manages salt minion keys on the salt master.
4 | > Needs to be run on the salt master, likely as root or with sudo.
5 |
6 | - List all accepted, unaccepted and rejected minion keys:
7 |
8 | `salt-key -L`
9 |
10 | - Accept a minion key by name:
11 |
12 | `salt-key -a {{MINION_ID}}`
13 |
14 | - Reject a minion key by name:
15 |
16 | `salt-key -r {{MINION_ID}}`
17 |
18 | - Print fingerprints of all public keys:
19 |
20 | `salt-key -F`
21 |
--------------------------------------------------------------------------------
/pages/common/git-branch.md:
--------------------------------------------------------------------------------
1 | # git branch
2 |
3 | > Main command for working with branches.
4 |
5 | - List local branches. The current branch is highlighted by `*`:
6 |
7 | `git branch`
8 |
9 | - List all local and remote branches:
10 |
11 | `git branch -a`
12 |
13 | - Create new branch based on current branch:
14 |
15 | `git branch {{BRANCH-NAME}}`
16 |
17 | - Delete a local branch:
18 |
19 | `git branch -d {{BRANCH-NAME}}`
20 |
21 | - Move/Rename a branch:
22 |
23 | `git branch -m`
24 |
--------------------------------------------------------------------------------
/pages/common/salt-call.md:
--------------------------------------------------------------------------------
1 | # salt-key
2 |
3 | > Invoke salt locally on a salt minion.
4 |
5 | - Perform a highstate on this minion:
6 |
7 | `salt-call state.highstate`
8 |
9 | - Perform a highstate dry-run, compute all changes but don't actually perform them:
10 |
11 | `salt-call state.highstate test=true`
12 |
13 | - Perform a highstate with verbose debugging output:
14 |
15 | `salt-call -l debug state.highstate`
16 |
17 | - List this minion's grains:
18 |
19 | `salt-call grains.items`
20 |
--------------------------------------------------------------------------------
/pages/common/strings.md:
--------------------------------------------------------------------------------
1 | # strings
2 |
3 | > Find printable strings in an object file or binary.
4 |
5 | - Print all strings in a binary:
6 |
7 | `strings {{file}}`
8 |
9 | - Limit results to strings at least *length* characters long:
10 |
11 | `strings -n {{length}} {{file}}`
12 |
13 | - Prefix each result with its offset within the file:
14 |
15 | `strings -t d {{file}}`
16 |
17 | - Prefix each result with its offset within the file in hexadecimal:
18 |
19 | `strings -t x {{file}}`
20 |
--------------------------------------------------------------------------------
/pages/linux/zypper.md:
--------------------------------------------------------------------------------
1 | # zypper
2 |
3 | > SUSE & openSUSE package management utility.
4 |
5 | - Synchronize list of packages and versions available:
6 |
7 | `zypper refresh`
8 |
9 | - Install a new package:
10 |
11 | `zypper install {{package}}`
12 |
13 | - Remove a package:
14 |
15 | `zypper remove {{package}}`
16 |
17 | - Upgrade installed packages to newest available versions:
18 |
19 | `zypper update`
20 |
21 | - Search package via keyword:
22 |
23 | `zypper search {{keyword}}`
24 |
--------------------------------------------------------------------------------
/pages/common/javac.md:
--------------------------------------------------------------------------------
1 | # javac
2 |
3 | > Java Application Compiler.
4 |
5 | - Compile a .java file:
6 |
7 | `javac {{filename.java}}`
8 |
9 | - Compile several .java files:
10 |
11 | `javac {{filename1.java}} {{filename2.java}} {{filename3.java}}`
12 |
13 | - Compile all .java files in current directory:
14 |
15 | `javac {{*.java}}`
16 |
17 | - Compile a .java file and place the resulting class file in a specific directory:
18 |
19 | `javac -d {{path/to/some/directory}} {{filename.java}}`
20 |
--------------------------------------------------------------------------------
/pages/common/jmap.md:
--------------------------------------------------------------------------------
1 | # jmap
2 |
3 | > Java Memory Map Tool.
4 |
5 | - Print shared object mappings for a java process (output like pmap):
6 |
7 | `jmap {{java_pid}}`
8 |
9 | - Print heap summary information:
10 |
11 | `jmap -heap {{filename.jar}} {{java_pid}}`
12 |
13 | - Print histogram of heap usage by type:
14 |
15 | `jmap -histo {{java_pid}}`
16 |
17 | - Dump contents of the heap into a binary file for analysis with jhat:
18 |
19 | `jmap -dump:format=b,file={{filename}} {{java_pid}}`
20 |
--------------------------------------------------------------------------------
/pages/common/mpc.md:
--------------------------------------------------------------------------------
1 | # mpc
2 |
3 | > Music Player Client.
4 | > Program for controlling the Music Player Daemon (MPD).
5 |
6 | - Toggle play/pause:
7 |
8 | `mpc toggle`
9 |
10 | - Stop playing:
11 |
12 | `mpc stop`
13 |
14 | - Show information about the currently playing song:
15 |
16 | `mpc status`
17 |
18 | - Play next song:
19 |
20 | `mpc next`
21 |
22 | - Play previous song:
23 |
24 | `mpc prev`
25 |
26 | - Forward or rewind the currently playing song:
27 |
28 | `mpc [+-]{{seconds}}`
29 |
--------------------------------------------------------------------------------
/pages/common/mysql.md:
--------------------------------------------------------------------------------
1 | # mysql
2 |
3 | > The MySQL command-line tool.
4 |
5 | - Connect to a database:
6 |
7 | `mysql {{database_name}}`
8 |
9 | - Connect to a database, user will be prompted for a password:
10 |
11 | `mysql -u {{user}} --password {{database_name}}`
12 |
13 | - Connect to a database on another host:
14 |
15 | `mysql -h {{database_host}} {{database_name}}`
16 |
17 | - Execute SQL statements in a script file (batch file):
18 |
19 | `mysql {{database_name}} < {{script.sql}}`
20 |
--------------------------------------------------------------------------------
/pages/linux/sysctl.md:
--------------------------------------------------------------------------------
1 | # sysctl
2 |
3 | > List and change kernel runtime variables.
4 |
5 | - Show all available variables and their values:
6 |
7 | `sysctl -a`
8 |
9 | - Set a changeable kernel state variable:
10 |
11 | `sysctl -w {{section.tunable}}={{value}}`
12 |
13 | - Get currently open file handlers:
14 |
15 | `sysctl fs.file-nr`
16 |
17 | - Get limit for simultaneous open files:
18 |
19 | `sysctl fs.file-max`
20 |
21 | - Apply changes from /etc/sysctl.conf:
22 |
23 | `sysctl -p`
24 |
--------------------------------------------------------------------------------
/pages/common/in2csv.md:
--------------------------------------------------------------------------------
1 | # in2csv
2 |
3 | > Converts various tabular data formats into CSV.
4 | > Included in csvkit.
5 |
6 | - Convert an XLS file to CSV:
7 |
8 | `in2csv {{data.xls}}`
9 |
10 | - Convert a DBF file to a CSV file:
11 |
12 | `in2csv {{data.dbf}} > {{data.csv}}`
13 |
14 | - Convert a specific sheet from an XLSX file to CSV:
15 |
16 | `in2csv --sheet={{sheet_name}} {{data.xlsx}}`
17 |
18 | - Pipe a JSON file to in2csv:
19 |
20 | `cat {{data.json}} | in2csv -f json > {{data.csv}}`
21 |
--------------------------------------------------------------------------------
/pages/common/play.md:
--------------------------------------------------------------------------------
1 | # play
2 |
3 | > Audio player of SoX - Sound eXchange.
4 | > Plays any audio from the command line.
5 | > Audioformats are identified by extension.
6 |
7 | - Play the given audio file:
8 |
9 | `play {{audiofile}}`
10 |
11 | - Play the given audio files:
12 |
13 | `play {{audiofile1}} {{audiofile2}}`
14 |
15 | - Play the given audio at twice the speed:
16 |
17 | `play {{audiofile}} speed 2.0`
18 |
19 | - Play the given audio in reverse:
20 |
21 | `play {{audiofile}} reverse`
22 |
--------------------------------------------------------------------------------
/pages/common/tmux.md:
--------------------------------------------------------------------------------
1 | # tmux
2 |
3 | > Multiplex several virtual consoles.
4 |
5 | - Start a new tmux session:
6 |
7 | `tmux`
8 |
9 | - Start a new named tmux session:
10 |
11 | `tmux new -s {{name}}`
12 |
13 | - List sessions:
14 |
15 | `tmux ls`
16 |
17 | - Attach to a session:
18 |
19 | `tmux a`
20 |
21 | - Attach to a named session:
22 |
23 | `tmux a -t {{name}}`
24 |
25 | - Detach from session:
26 |
27 | `ctrl+b d`
28 |
29 | - Kill session:
30 |
31 | `tmux kill-session -t {{name}}`
32 |
--------------------------------------------------------------------------------
/pages/linux/head.md:
--------------------------------------------------------------------------------
1 | # head
2 |
3 | > Output the first part of files.
4 |
5 | - Output the first few lines of a file:
6 |
7 | `head -n {{count_of_lines}} {{filename}}`
8 |
9 | - Output the first few bytes of a file:
10 |
11 | `head -c {{size_in_bytes}} {{filename}}`
12 |
13 | - Output everything but the last few lines of a file:
14 |
15 | `head -n -{{count_of_lines}} {{filename}}`
16 |
17 | - Output everything but the last few bytes of a file:
18 |
19 | `head -c -{{size_in_bytes}} {{filename}}`
20 |
--------------------------------------------------------------------------------
/pages/linux/mkfs.fat.md:
--------------------------------------------------------------------------------
1 | # mkfs.fat
2 |
3 | > Creates an MS-DOS filesystem inside a partition.
4 |
5 | - Create a fat filesystem inside partition 1 on device b (`sdb1`):
6 |
7 | `mkfs.fat {{/dev/sdb1}}`
8 |
9 | - Create filesystem with a volume-name:
10 |
11 | `mkfs.fat -n {{volume-name}} {{/dev/sdb1}}`
12 |
13 | - Create filesystem with a volume-id:
14 |
15 | `mkfs.fat -i {{volume-id}} {{/dev/sdb1}}`
16 |
17 | - Use 5 instead of 2 file allocation tables:
18 |
19 | `mkfs.fat -f 5 {{/dev/sdb1}}`
20 |
--------------------------------------------------------------------------------
/pages/linux/wpa_cli.md:
--------------------------------------------------------------------------------
1 | # wpa_cli
2 |
3 | > Add and configure wlan interfaces.
4 |
5 | - Scan for available networks:
6 |
7 | `wpa_cli scan`
8 |
9 | - Show scan results:
10 |
11 | `wpa_cli scan_results`
12 |
13 | - Add a network:
14 |
15 | `wpa_cli add_network {{number}}`
16 |
17 | - Set a network's SSID:
18 |
19 | `wpa_cli set_network {{number}} ssid "{{SSID}}"`
20 |
21 | - Enable network:
22 |
23 | `wpa_cli enable_network {{number}}`
24 |
25 | - Save config:
26 |
27 | `wpa_cli save_config`
28 |
--------------------------------------------------------------------------------
/pages/common/adb.md:
--------------------------------------------------------------------------------
1 | # Android Debug Bridge
2 |
3 | > Communicate with an Android emulator instance or connected Android devices.
4 |
5 | - Check whether the adb server process is running and start it:
6 |
7 | `adb start-server`
8 |
9 | - Terminate the adb server process:
10 |
11 | `adb kill-server`
12 |
13 | - Start a remote shell in the target emulator/device instance:
14 |
15 | `adb shell`
16 |
17 | - Push an Android application to an emulator/device:
18 |
19 | `adb install -r {{path/to/file.apk}}`
20 |
--------------------------------------------------------------------------------
/pages/common/axel.md:
--------------------------------------------------------------------------------
1 | # axel
2 |
3 | > Download accelerator.
4 | > Supports HTTP, HTTPS, and FTP.
5 |
6 | - Download a URL to a file:
7 |
8 | `axel {{url}}`
9 |
10 | - Download and specify filename:
11 |
12 | `axel {{url}} -o {{filename}}`
13 |
14 | - Download with multiple connections:
15 |
16 | `axel -n {{connections_num}} {{url}}`
17 |
18 | - Search for mirrors:
19 |
20 | `axel -S {{mirrors_num}} {{url}}`
21 |
22 | - Limit download speed (bytes per second):
23 |
24 | `axel -s {{speed}} {{url}}`
25 |
--------------------------------------------------------------------------------
/pages/common/bundle.md:
--------------------------------------------------------------------------------
1 | # bundle
2 |
3 | > Dependency manager for the Ruby programming language.
4 |
5 | - Install all gems defined in the gemfile expected in the working directory:
6 |
7 | `bundle install`
8 |
9 | - Update all gems by the rules defined in the gemfile and regenerate gemfile.lock:
10 |
11 | `bundle update`
12 |
13 | - Update one specific gem defined in the gemfile:
14 |
15 | `bundle update --source {{gemname}}`
16 |
17 | - Create a new gem skeleton:
18 |
19 | `bundle gem {{gemname}}`
20 |
--------------------------------------------------------------------------------
/pages/common/cloc.md:
--------------------------------------------------------------------------------
1 | # cloc
2 |
3 | > Count, and compute differences of, lines of source code and comments.
4 |
5 | - Count all the lines of code in a directory:
6 |
7 | `cloc {{/path/to/directory}}`
8 |
9 | - Count all the lines of code in a directory, displaying a progress bar during the counting process:
10 |
11 | `cloc --progress=1 {{/path/to/directory}}`
12 |
13 | - Compare 2 directory sturctures and count the differences between them:
14 |
15 | `cloc --diff {{/directory/one}} {{/directory/two}}`
16 |
--------------------------------------------------------------------------------
/pages/common/redis-cli.md:
--------------------------------------------------------------------------------
1 | # redis-cli
2 |
3 | > Opens a connection to a Redis server.
4 |
5 | - Connect to the local server:
6 |
7 | `redis-cli`
8 |
9 | - Connect to a remote server on the default port (6379):
10 |
11 | `redis-cli -h {{host}}`
12 |
13 | - Connect to a remote server specifying a port number:
14 |
15 | `redis-cli -h {{host}} -p {{port}}`
16 |
17 | - Specify a password:
18 |
19 | `redis-cli -a {{password}}`
20 |
21 | - Execute Redis command:
22 |
23 | `redis-cli {{redis command}}`
24 |
--------------------------------------------------------------------------------
/pages/common/sort.md:
--------------------------------------------------------------------------------
1 | # sort
2 |
3 | > Sort lines of text files.
4 |
5 | - Sort a file in ascending order:
6 |
7 | `sort {{filename}}`
8 |
9 | - Sort a file in descending order:
10 |
11 | `sort -r {{filename}}`
12 |
13 | - Sort a file using numeric rather than alphabetic order:
14 |
15 | `sort -n {{filename}}`
16 |
17 | - Sort the passwd file by the 3rd field, numerically:
18 |
19 | `sort -t: -k 3n /etc/passwd`
20 |
21 | - Sort a file preserving only unique lines:
22 |
23 | `sort -u {{filename}}`
24 |
--------------------------------------------------------------------------------
/pages/common/unrar.md:
--------------------------------------------------------------------------------
1 | # unrar
2 |
3 | > Extract RAR archives.
4 |
5 | - Extract files with original directory structure:
6 |
7 | `unrar x {{compressed.rar}}`
8 |
9 | - Extract files into current directory, losing directory structure in the archive:
10 |
11 | `unrar e {{compressed.rar}}`
12 |
13 | - Test integrity of each file inside the archive file:
14 |
15 | `unrar t {{compressed.rar}}`
16 |
17 | - List files inside the archive file without decompressing it:
18 |
19 | `unrar l {{compressed.rar}}`
20 |
--------------------------------------------------------------------------------
/pages/linux/mkfs.vfat.md:
--------------------------------------------------------------------------------
1 | # mkfs.vfat
2 |
3 | > Creates an MS-DOS filesystem inside a partition.
4 |
5 | - Create a.vfat filesystem inside partition 1 on device b (`sdb1`):
6 |
7 | `mkfs.vfat {{/dev/sdb1}}`
8 |
9 | - Create filesystem with a volume-name:
10 |
11 | `mkfs.vfat -n {{volume-name}} {{/dev/sdb1}}`
12 |
13 | - Create filesystem with a volume-id:
14 |
15 | `mkfs.vfat -i {{volume-id}} {{/dev/sdb1}}`
16 |
17 | - Use 5 instead of 2 file allocation tables:
18 |
19 | `mkfs.vfat -f 5 {{/dev/sdb1}}`
20 |
--------------------------------------------------------------------------------
/pages/linux/strace.md:
--------------------------------------------------------------------------------
1 | # strace
2 |
3 | > Troubleshooting tool for tracing system calls.
4 |
5 | - Start tracing a specific process by its PID:
6 |
7 | `strace -p {{pid}}`
8 |
9 | - Trace a process and filter output by system call:
10 |
11 | `strace -p {{pid}} -e {{system call name}}`
12 |
13 | - Count time, calls, and errors for each system call and report a summary on program exit:
14 |
15 | `strace -p {{pid}} -c`
16 |
17 | - Show the time spent in every system call:
18 |
19 | `strace -p {{pid}} -T`
20 |
--------------------------------------------------------------------------------
/pages/osx/ditto.md:
--------------------------------------------------------------------------------
1 | # ditto
2 |
3 | > Copy files and folders.
4 |
5 | - Overwrite contents of destination folder with contents of source folder:
6 |
7 | `ditto {{path/to/source}} {{path/to/destination}}`
8 |
9 | - Print a line to the Terminal window for every file that’s being copied:
10 |
11 | `ditto -V {{path/to/source}} {{path/to/destination}}`
12 |
13 | - Copy a given file or folder, while retaining the original file permissions:
14 |
15 | `ditto -rsrc {{path/to/source}} {{path/to/destination}}`
16 |
--------------------------------------------------------------------------------
/pages/osx/system_profiler.md:
--------------------------------------------------------------------------------
1 | # system_profiler
2 |
3 | > Report system hardware and software configuration.
4 |
5 | - Display a full system profiler report which can be opened by System Profiler.app:
6 |
7 | `system_profiler -xml > MyReport.spx`
8 |
9 | - Display a hardware overview (Model, CPU, Memory, Serial, etc):
10 |
11 | `system_profiler SPHardwareDataType`
12 |
13 | - Print the system serial number:
14 |
15 | `system_profiler SPHardwareDataType|grep "Serial Number (system)" |awk '{print $4}'`
16 |
--------------------------------------------------------------------------------
/pages/common/csvsort.md:
--------------------------------------------------------------------------------
1 | # csvsort
2 |
3 | > Sorts CSV files.
4 | > Included in csvkit.
5 |
6 | - Sort a CSV file by column 9:
7 |
8 | `csvsort -c {{9}} {{data.csv}}`
9 |
10 | - Sort a CSV file by the "name" column in descending order:
11 |
12 | `csvsort -r -c {{name}} {{data.csv}}`
13 |
14 | - Sort a CSV file by column 2, then by column 4:
15 |
16 | `csvsort -c {{2,4}} {{data.csv}}`
17 |
18 | - Sort a CSV file without inferring data types:
19 |
20 | `csvsort --no-inference -c {{columns}} {{data.csv}}`
21 |
--------------------------------------------------------------------------------
/pages/common/ghc.md:
--------------------------------------------------------------------------------
1 | # ghc
2 |
3 | > The Glasgow Haskell Compiler.
4 | > Compiles and links Haskell source files.
5 |
6 | - Find and compile all modules in the current directory:
7 |
8 | `ghc Main`
9 |
10 | - Compile a single file:
11 |
12 | `ghc {{file.hs}}`
13 |
14 | - Compile using extra optimization:
15 |
16 | `ghc -O {{file.hs}}`
17 |
18 | - Stop compilation after generating object files (.o):
19 |
20 | `ghc -c {{file.hs}}`
21 |
22 | - Run Haskell interactive interpreter (REPL):
23 |
24 | `ghci`
25 |
--------------------------------------------------------------------------------
/pages/common/pigz.md:
--------------------------------------------------------------------------------
1 | # pigz
2 |
3 | > Multithreaded zlib compression utility.
4 |
5 | - Compress a file with default options:
6 |
7 | `pigz {{filename}}`
8 |
9 | - Compress a file using the best compression method:
10 |
11 | `pigz -9 {{filename}}`
12 |
13 | - Compress a file using no compression and 4 processors:
14 |
15 | `pigz -0 -p{{4}} {{filename}}`
16 |
17 | - Decompress a file:
18 |
19 | `pigz -d {{archive.gz}}`
20 |
21 | - List the contents of an archive:
22 |
23 | `pigz -l {{archive.tar.gz}}`
24 |
--------------------------------------------------------------------------------
/pages/common/salt.md:
--------------------------------------------------------------------------------
1 | # salt
2 |
3 | > Execute commands and assert state on remote salt minions.
4 |
5 | - List connected minions:
6 |
7 | `salt '*' test.ping`
8 |
9 | - Execute a highstate on all connected minions:
10 |
11 | `salt '*' state.highstate`
12 |
13 | - Upgrade packages using the OS package manager (apt, yum, brew) on a subset of minions:
14 |
15 | `salt '*.domain.com' pkg.upgrade`
16 |
17 | - Execute an arbitrary command on a particular minion:
18 |
19 | `salt '{{minion_id}}' cmd.run "ls "`
20 |
--------------------------------------------------------------------------------
/pages/common/sshfs.md:
--------------------------------------------------------------------------------
1 | # SSHFS
2 |
3 | > Filesystem client based on ssh.
4 |
5 | - Mount remote directory:
6 |
7 | `sshfs {{username}}@{{remote_host}}:{{remote_directory}} {{mountpoint}}`
8 |
9 | - Unmount remote directory:
10 |
11 | `fusermount -u {{mountpoint}}`
12 |
13 | - Mount remote directory from server with specific port:
14 |
15 | `sshfs {{username}}@{{remote_host}}:{{remote_directory}} -p {{2222}}`
16 |
17 | - Use compression:
18 |
19 | `sshfs {{username}}@{{remote_host}}:{{remote_directory}} -C`
20 |
--------------------------------------------------------------------------------
/pages/linux/ip.md:
--------------------------------------------------------------------------------
1 | # ip
2 |
3 | > Show / manipulate routing, devices, policy routing and tunnels.
4 |
5 | - List interfaces with detailed info:
6 |
7 | `ip a`
8 |
9 | - Display the routing table:
10 |
11 | `ip r`
12 |
13 | - Make an interface up/down:
14 |
15 | `ip link set {{interface}} up/down`
16 |
17 | - Add/Delete an ip address to an interface:
18 |
19 | `ip addr add/del {{ip}}/{{mask}} dev {{interface}}`
20 |
21 | - Add an default route:
22 |
23 | `ip route add default via {{ip}} dev {{interface}}`
24 |
--------------------------------------------------------------------------------
/pages/linux/notify-send.md:
--------------------------------------------------------------------------------
1 | # notify-send
2 |
3 | > Uses the current desktop environment's notification system to create a notification.
4 |
5 | - Show a notification with the title "Test" and the content "This is a test":
6 |
7 | `notify-send {{"Test"}} {{"This is a test"}}`
8 |
9 | - Show a notification with a custom icon:
10 |
11 | `notify-send -i {{icon.png}} {{"Test"}} {{"This is a test"}}`
12 |
13 | - Show a notification for 5 seconds:
14 |
15 | `notify-send -t 5000 {{"Test"}} {{"This is a test"}}`
16 |
--------------------------------------------------------------------------------
/pages/osx/xctool.md:
--------------------------------------------------------------------------------
1 | # XCTool
2 |
3 | > Tool for building Xcode projects.
4 |
5 | - Build a single project without any workspace:
6 |
7 | `xctool.sh -project {{YourProject.xcodeproj}} -scheme {{YourScheme}} build`
8 |
9 | - Build a project that is part of a workspace:
10 |
11 | `xctool -workspace {{YourWorkspace.xcworkspace}} -scheme {{YourScheme}} build`
12 |
13 | - Clean, build and execute all the tests:
14 |
15 | `xctool -workspace {{YourWorkspace.xcworkspace}} -scheme {{YourScheme}} clean build test`
16 |
--------------------------------------------------------------------------------
/pages/common/drush.md:
--------------------------------------------------------------------------------
1 | # drush
2 |
3 | > A command-line shell and scripting interface for Drupal.
4 |
5 | - Download module "foo":
6 |
7 | `drush dl {{foo}}`
8 |
9 | - Download version 7.x-2.1-beta1 of module "foo":
10 |
11 | `drush dl {{foo}}-7.x-2.1-beta1`
12 |
13 | - Enable module "foo":
14 |
15 | `drush en {{foo}}`
16 |
17 | - Disable module "foo":
18 |
19 | `drush dis {{foo}}`
20 |
21 | - Clear all caches:
22 |
23 | `drush cc all`
24 |
25 | - Clear CSS and JavaScript caches:
26 |
27 | `drush cc css-js`
28 |
--------------------------------------------------------------------------------
/pages/common/fswebcam.md:
--------------------------------------------------------------------------------
1 | # fswebcam
2 |
3 | > Small and simple webcam for *nix.
4 |
5 | - Take a picture:
6 |
7 | `fswebcam {{filename}}`
8 |
9 | - Take a picture with custom resolution:
10 |
11 | `fswebcam -r {{width}}x{{height}} {{filename}}`
12 |
13 | - Take a picture from selected device(Default is /dev/vidoe0):
14 |
15 | `fswebcam -d {{device}} {{filename}}`
16 |
17 | - Take a picture with timestamp(timestamp string is formatted by strftime):
18 |
19 | `fswebcam --timestamp {{timestamp}} {{filename}}`
20 |
--------------------------------------------------------------------------------
/pages/common/mdp.md:
--------------------------------------------------------------------------------
1 | # mdp
2 |
3 | > A command-line based tool to make presentations from markdown files.
4 |
5 | - Launch a presentation in the terminal from a markdown file:
6 |
7 | `mdp {{presentation.md}}`
8 |
9 | - Disable fading transitions:
10 |
11 | `mdp --nofade {{presentation.md}}`
12 |
13 | - Invert font colors to use in terminals with light background:
14 |
15 | `mdp --invert {{presentation.md}}`
16 |
17 | - Disable transparency in transparent terminals:
18 |
19 | `mdp --notrans {{presentation.md}}`
20 |
--------------------------------------------------------------------------------
/pages/osx/sysctl.md:
--------------------------------------------------------------------------------
1 | # sysctl
2 |
3 | > Access kernel state information.
4 |
5 | - Show all available variables and their values:
6 |
7 | `sysctl -a`
8 |
9 | - Show Apple model identifier:
10 |
11 | `sysctl -n hw.model`
12 |
13 | - Show CPU model:
14 |
15 | `sysctl -n machdep.cpu.brand_string`
16 |
17 | - Show available CPU features (MMX, SSE, SSE2, SSE3, AES, etc):
18 |
19 | `sysctl -n machdep.cpu.feature`
20 |
21 | - Set a changeable kernel state variable:
22 |
23 | `sysctl -w {{section.tunable}}={{value}}`
24 |
--------------------------------------------------------------------------------
/pages/common/c99.md:
--------------------------------------------------------------------------------
1 | # C99
2 |
3 | > Compiles C programs according to the ISO C standard.
4 |
5 | - Compile source file(s) and create an executable:
6 |
7 | `c99 {{file.c}}`
8 |
9 | - Compile source file(s) and create an executable with a custom name:
10 |
11 | `c99 -o {{executable_name}} {{file.c}}`
12 |
13 | - Compile source file(s) and create object file(s):
14 |
15 | `c99 -c {{file.c}}`
16 |
17 | - Compile source file(s), link with object file(s), and create an executable:
18 |
19 | `c99 {{file.c}} {{file.o}}`
20 |
--------------------------------------------------------------------------------
/pages/common/file.md:
--------------------------------------------------------------------------------
1 | # file
2 |
3 | > Determine file type.
4 |
5 | - Give a description of the type of the specified file. Works fine for files with no file extension:
6 |
7 | `file {{filename}}`
8 |
9 | - Look inside a zipped file and determine the file type(s) inside:
10 |
11 | `file -z {{foo.zip}}`
12 |
13 | - Allow file to work with special or device files:
14 |
15 | `file -s {{filename}}`
16 |
17 | - Don't stop at first file type match; keep going until the end of the file:
18 |
19 | `file -k {{filename}}`
20 |
--------------------------------------------------------------------------------
/pages/common/nix-env.md:
--------------------------------------------------------------------------------
1 | # nix-env
2 |
3 | > Manipulate or query Nix user environments.
4 |
5 | - Show available package with name or without name:
6 |
7 | `nix-env -qa {{pkg_name}}`
8 |
9 | - Show the status of available packages:
10 |
11 | `nix-env -qas`
12 |
13 | - Install package:
14 |
15 | `nix-env -i {{pkg_name}}`
16 |
17 | - Uninstall package:
18 |
19 | `nix-env -e {{pkg_name}}`
20 |
21 | - Upgrade one package:
22 |
23 | `nix-env -u {{pkg_name}}`
24 |
25 | - Upgrade all packages:
26 |
27 | `nix-env -u`
28 |
--------------------------------------------------------------------------------
/pages/common/tput.md:
--------------------------------------------------------------------------------
1 | # tput
2 |
3 | > View and modify terminal settings and capabilities.
4 |
5 | - Move the cursor to a screen location:
6 |
7 | `tput cup {{y_coordinate}} {{x_coordinate}}`
8 |
9 | - Set foreground (af) or background (ab) color:
10 |
11 | `tput {{setaf|setab}} {{ansi_color_code}}`
12 |
13 | - Show number of columns, lines, or colors:
14 |
15 | `tput {{cols|lines|colors}}`
16 |
17 | - Ring the terminal bell:
18 |
19 | `tput bel`
20 |
21 | - Reset all terminal attributes:
22 |
23 | `tput sgr0`
24 |
--------------------------------------------------------------------------------
/pages/common/xargs.md:
--------------------------------------------------------------------------------
1 | # xargs
2 |
3 | > Execute a command with piped arguments.
4 |
5 | - Main use:
6 |
7 | `{{arguments}} | xargs {{command}}`
8 |
9 | - Specific example: delete all files that start with 'M':
10 |
11 | `find . -name 'M*' | xargs rm`
12 |
13 | - Handle whitespace in arguments:
14 |
15 | `{{arguments_null_terminated}} | xargs -0 {{command}}`
16 |
17 | - Insert arguments at chosen position, using '%' as the placeholder marker:
18 |
19 | `{{arguments}} | xargs -I '%' {{command}} % {{extra_arguments}}`
20 |
--------------------------------------------------------------------------------
/pages/linux/ltrace.md:
--------------------------------------------------------------------------------
1 | # ltrace
2 |
3 | > Display dynamic library calls of a process.
4 |
5 | - Print (trace) library calls of a program binary:
6 |
7 | `ltrace ./{{program}}`
8 |
9 | - Count library calls. Print a handy summary at the bottom:
10 |
11 | `ltrace -c {{/path/to/program}}`
12 |
13 | - Trace calls to malloc and free, omit those done by libc:
14 |
15 | `ltrace -e malloc+free-@libc.so* {{/path/to/program}}`
16 |
17 | - Write to file instead of terminal:
18 |
19 | `ltrace -o {{file}} {{/path/to/program}}`
20 |
--------------------------------------------------------------------------------
/pages/common/fortune.md:
--------------------------------------------------------------------------------
1 | # fortune
2 |
3 | > Print a random quotation (fortune-cookie style).
4 |
5 | - Print a quotation:
6 |
7 | `fortune`
8 |
9 | - Print an offensive quotation:
10 |
11 | `fortune -o`
12 |
13 | - Print a long quotation:
14 |
15 | `fortune -l`
16 |
17 | - Print a short quotation:
18 |
19 | `fortune -s`
20 |
21 | - List the available quotation database files:
22 |
23 | `fortune -f`
24 |
25 | - Print a quotation from one of the database files listed by `fortune -f`:
26 |
27 | `fortune {{filename}}`
28 |
--------------------------------------------------------------------------------
/pages/common/ifconfig.md:
--------------------------------------------------------------------------------
1 | # ifconfig
2 |
3 | > Ifconfig - Interface Configurator, used to configure network interfaces.
4 |
5 | - View network settings of an ethernet adapter:
6 |
7 | `ifconfig eth0`
8 |
9 | - Display details of all interfaces, including disabled interfaces:
10 |
11 | `ifconfig -a`
12 |
13 | - Disable eth0 interface:
14 |
15 | `ifconfig eth0 down`
16 |
17 | - Enable eth0 interface:
18 |
19 | `ifconfig eth0 up`
20 |
21 | - Assign IP address to eth0 interface:
22 |
23 | `ifconfig eth0 {{ip_address}}`
24 |
--------------------------------------------------------------------------------
/pages/linux/lsblk.md:
--------------------------------------------------------------------------------
1 | # lsblk
2 |
3 | > Lists information about devices.
4 |
5 | - List all storage devices in a tree-like format:
6 |
7 | `lsblk`
8 |
9 | - Also list empty devices:
10 |
11 | `lsblk -a`
12 |
13 | - Print the SIZE column in bytes rather than in a human-readable format:
14 |
15 | `lsblk -b`
16 |
17 | - Output info about filesystems:
18 |
19 | `lsblk -f`
20 |
21 | - Use ASCII characters for tree formatting:
22 |
23 | `lsblk -i`
24 |
25 | - Output info about block-device topology:
26 |
27 | `lsblk -t`
28 |
--------------------------------------------------------------------------------
/pages/linux/pkgmk.md:
--------------------------------------------------------------------------------
1 | # pkgmk
2 |
3 | > Make a binary package for use with pkgadd on CRUX.
4 |
5 | - Make and download a package:
6 |
7 | `pkgmk -d`
8 |
9 | - Install the package after making it:
10 |
11 | `pkgmk -d -i`
12 |
13 | - Upgrade the package after making it:
14 |
15 | `pkgmk -d -u`
16 |
17 | - Ignore the footprint when making a package:
18 |
19 | `pkgmk -d -if`
20 |
21 | - Ignore the MD5 sum when making a package:
22 |
23 | `pkgmk -d -im`
24 |
25 | - Update the package's footprint:
26 |
27 | `pkgmk -uf`
28 |
--------------------------------------------------------------------------------
/pages/common/git-remote.md:
--------------------------------------------------------------------------------
1 | # git remote
2 |
3 | > Manage set of tracked repositories ("remotes").
4 |
5 | - Show a list of existing remotes, their names and URL:
6 |
7 | `git remote -v`
8 |
9 | - Add a remote:
10 |
11 | `git remote add {{remote_name}} {{remote_url}}`
12 |
13 | - Change the URL of a remote:
14 |
15 | `git remote set-url {{remote_name}} {{new_url}}`
16 |
17 | - Remove a remote:
18 |
19 | `git remote remove {{remote_name}}`
20 |
21 | - Rename a remote:
22 |
23 | `git remote rename {{old_name}} {{new_name}}`
24 |
--------------------------------------------------------------------------------
/pages/common/optipng.md:
--------------------------------------------------------------------------------
1 | # optipng
2 |
3 | > PNG image file optimization utility.
4 |
5 | - Compress a PNG with default settings:
6 |
7 | `optipng {{file.png}}`
8 |
9 | - Compress a PNG with best compression:
10 |
11 | `optipng -o{{7}} {{file.png}}`
12 |
13 | - Compress a PNG with fastest compression:
14 |
15 | `optipng -o{{0}} {{file.png}}`
16 |
17 | - Compress a PNG and add interlacing:
18 |
19 | `optipng -i {{1}} {{file.png}}`
20 |
21 | - Compress a PNG and remove all metadata:
22 |
23 | `optipng -strip all {{file.png}}`
24 |
--------------------------------------------------------------------------------
/pages/common/xz.md:
--------------------------------------------------------------------------------
1 | # xz
2 |
3 | > Compress or decompress .xz and .lzma files.
4 |
5 | - Compress a file:
6 |
7 | `xz {{file}}`
8 |
9 | - Decompress a file:
10 |
11 | `xz -d {{file.xz}}`
12 |
13 | - Decompress a file and write to stdout:
14 |
15 | `xz -dc {{file.xz}}`
16 |
17 | - Compress a file, but don't delete the original:
18 |
19 | `xz -k {{file}}`
20 |
21 | - Compress a file using the fastest compression:
22 |
23 | `xz -0 {{file}}`
24 |
25 | - Compress a file using the best compression:
26 |
27 | `xz -9 {{file}}`
28 |
--------------------------------------------------------------------------------
/pages/linux/jobs.md:
--------------------------------------------------------------------------------
1 | # jobs
2 |
3 | > BASH builtin for viewing information about processes spawned by the current shell.
4 |
5 | - View jobs spawned by the current shell:
6 |
7 | `jobs`
8 |
9 | - List jobs and their process ids:
10 |
11 | `jobs -l`
12 |
13 | - Display information about jobs with changed status:
14 |
15 | `jobs -n`
16 |
17 | - Display process id of process group leader:
18 |
19 | `jobs -p`
20 |
21 | - Display running processes:
22 |
23 | `jobs -r`
24 |
25 | - Display stopped processes:
26 |
27 | `jobs -s`
28 |
--------------------------------------------------------------------------------
/pages/linux/sort.md:
--------------------------------------------------------------------------------
1 | # sort
2 |
3 | > Sort lines of text files.
4 |
5 | - Sort a file in ascending order:
6 |
7 | `sort {{filename}}`
8 |
9 | - Sort a file in descending order:
10 |
11 | `sort -r {{filename}}`
12 |
13 | - Sort a file using numeric rather than alphabetic order:
14 |
15 | `sort -n {{filename}}`
16 |
17 | - Sort the passwd file by the 3rd field, numerically:
18 |
19 | `sort -t: -k 3n /etc/passwd`
20 |
21 | - Sort human-readable numbers (in this case the 5th field of `ls -lh`):
22 |
23 | `ls -lh | sort -h -k 5`
24 |
--------------------------------------------------------------------------------
/pages/osx/du.md:
--------------------------------------------------------------------------------
1 | # du
2 |
3 | > Estimate file space usage.
4 |
5 | - Get a sum of the total size of a file/folder in human readable units:
6 |
7 | `du -sh {{file/directory}}`
8 |
9 | - List file sizes of a directory and any subdirectories in KB:
10 |
11 | `du -k {{file/directory}}`
12 |
13 | - Get recursively, individual file/folder sizes in human readable form:
14 |
15 | `du -ah {{directory}}`
16 |
17 | - List the KB sizes of directories for N levels below the specified directory:
18 |
19 | `du -k -depth=1 {{directory}}`
20 |
--------------------------------------------------------------------------------
/pages/common/git-diff.md:
--------------------------------------------------------------------------------
1 | # git diff
2 |
3 | > Show changes to tracked files.
4 |
5 | - Show changes to tracked files:
6 |
7 | `git diff {{PATHSPEC}}`
8 |
9 | - Show only names of changed files:
10 |
11 | `git diff --name-only {{PATHSPEC}}`
12 |
13 | - Output a condensed summary of extended header information:
14 |
15 | `git diff --summary {{PATHSPEC}}`
16 |
17 | - Show staged (added, but not yet committed) changes only:
18 |
19 | `git diff --staged`
20 |
21 | - Create a patch file:
22 |
23 | `git diff > {{target-file.patch}}`
24 |
--------------------------------------------------------------------------------
/pages/linux/expand.md:
--------------------------------------------------------------------------------
1 | # expand
2 |
3 | > Convert tabs to spaces.
4 |
5 | - Convert tabs in each file to spaces, writing to standard output:
6 |
7 | `expand {{file}}`
8 |
9 | - Convert tabs to spaces, reading from standard input:
10 |
11 | `expand`
12 |
13 | - Do not convert tabs after non blanks:
14 |
15 | `expand -i {{file}}`
16 |
17 | - Have tabs a certain number of characters apart, not 8:
18 |
19 | `expand -t={{number}} {{file}}`
20 |
21 | - Use comma separated list of explicit tab positions:
22 |
23 | `expand -t={{list}}`
24 |
--------------------------------------------------------------------------------
/pages/common/chgrp.md:
--------------------------------------------------------------------------------
1 | # chgrp
2 |
3 | > Change group ownership of files and folders.
4 |
5 | - Change the owner of a file/folder:
6 |
7 | `chgrp {{group}} {{path/to/file}}`
8 |
9 | - Recursively change the owner of a folder and its contents:
10 |
11 | `chgrp -R {{group}} {{path/to/folder}}`
12 |
13 | - Change the owner of a symbolic link:
14 |
15 | `chgrp -h {{user}} {{path/to/symlink}}`
16 |
17 | - Change the owner of a file/folder to match a reference file:
18 |
19 | `chgrp --reference={{path/to/reference_file}} {{path/to/file}}`
20 |
--------------------------------------------------------------------------------
/pages/common/csvgrep.md:
--------------------------------------------------------------------------------
1 | # csvgrep
2 |
3 | > Filter CSV rows with string and pattern matching.
4 | > Included in csvkit.
5 |
6 | - Find rows that have a certain string in column 1:
7 |
8 | `csvgrep -c {{1}} -m {{string_to_match}} {{data.csv}}`
9 |
10 | - Find rows in which columns 3 or 4 match a certain regex pattern:
11 |
12 | `csvgrep -c {{3,4}} -r {{regex_pattern}} {{data.csv}}`
13 |
14 | - Find rows in which the "name" column does NOT include the string "John Doe":
15 |
16 | `csvgrep -i -c {{name}} -m {{"John Doe"}} {{data.csv}}`
17 |
--------------------------------------------------------------------------------
/pages/linux/timedatectl.md:
--------------------------------------------------------------------------------
1 | # timedatectl
2 |
3 | > Control the system time and date.
4 |
5 | - To check the current system clock time:
6 |
7 | `timedatectl`
8 |
9 | - To set the local time of the system clock directly:
10 |
11 | `timedatectl set-time {{"yyyy-MM-dd hh:mm:ss"}}`
12 |
13 | - To list available timezones:
14 |
15 | `timedatectl list-timezones`
16 |
17 | - To change timezones:
18 |
19 | `timedatectl set-timezone {{timezone}}`
20 |
21 | - To enable Network Time Protocol (NTP) syncing:
22 |
23 | `timedatectl set-ntp on`
24 |
--------------------------------------------------------------------------------
/pages/osx/open.md:
--------------------------------------------------------------------------------
1 | # open
2 |
3 | > Opens files, directories and applications.
4 |
5 | - Open a file with the associated application:
6 |
7 | `open {{file.ext}}`
8 |
9 | - Run a graphical MacOSX application:
10 |
11 | `open /Applications/{{Application.app}}`
12 |
13 | - Open the current directory in Finder:
14 |
15 | `open .`
16 |
17 | - Reveal a file in finder:
18 |
19 | `open -R {{path/to/file}}`
20 |
21 | - Open all the files of a given extension in the current directory with the associated application:
22 |
23 | `open {{*.ext}}`
24 |
--------------------------------------------------------------------------------
/pages/common/autojump.md:
--------------------------------------------------------------------------------
1 | # autojump
2 |
3 | > Quickly jump among the directories you visit the most.
4 | > Aliases like j or jc are provided for even less typing.
5 |
6 | - Jump to a directory that contains the given pattern:
7 |
8 | `j {{pattern}}`
9 |
10 | - Jump to a sub-directory (child) of the current directory that contains the given pattern:
11 |
12 | `jc {{pattern}}`
13 |
14 | - Remove non-existing directories from the autojump database:
15 |
16 | `j --purge`
17 |
18 | - Show the entries in the autojump database:
19 |
20 | `j -s`
21 |
--------------------------------------------------------------------------------
/pages/common/diff.md:
--------------------------------------------------------------------------------
1 | # diff
2 |
3 | > Compare files and directories.
4 |
5 | - Compare files:
6 |
7 | `diff {{file1}} {{file2}}`
8 |
9 | - Compare files, ignoring white spaces:
10 |
11 | `diff -w {{file1}} {{file2}}`
12 |
13 | - Compare files, showing differences side by side:
14 |
15 | `diff -y {{file1}} {{file2}}`
16 |
17 | - Compare directories recursively:
18 |
19 | `diff -r {{directory1}} {{directory2}}`
20 |
21 | - Compare directories, only showing the names of files that differ:
22 |
23 | `diff -rq {{directory1}} {{directory2}}`
24 |
--------------------------------------------------------------------------------
/pages/common/dirs.md:
--------------------------------------------------------------------------------
1 | # dirs
2 |
3 | > Displays or manipulates the directory stack.
4 | > The directory stack is a list of recently visited directories that can be manipulated with the `pushd` and `popd` commands.
5 |
6 | - Display the directory stack with a space between each entry:
7 |
8 | `dirs`
9 |
10 | - Display the directory stack with one entry per line:
11 |
12 | `dirs -p`
13 |
14 | - Display only the nth entry in the directory stack, starting at 0:
15 |
16 | `dirs +{{N}}`
17 |
18 | - Clear the directory stack:
19 |
20 | `dirs -c`
21 |
--------------------------------------------------------------------------------
/pages/common/dokku.md:
--------------------------------------------------------------------------------
1 | # Dokku
2 |
3 | > Docker powered mini-Heroku (PaaS).
4 | > Easily deploy multiple apps to your server in different languages using a single `git-push` command.
5 |
6 | - List runinng apps:
7 |
8 | `dokku apps`
9 |
10 | - Create an app:
11 |
12 | `dokku apps:create {{app_name}}`
13 |
14 | - Remove an app:
15 |
16 | `dokku apps:destroy {{app_name}}`
17 |
18 | - Install plugin:
19 |
20 | `dokku plugin:install {{full_repo_url}}`
21 |
22 | - Link database to an app:
23 |
24 | `dokku {{db}}:link {{db_name}} {{app_name}}`
25 |
--------------------------------------------------------------------------------
/pages/common/fsck.md:
--------------------------------------------------------------------------------
1 | # fsck
2 |
3 | > Check the integrity of a filesystem or repair it. The filesystem should be unmounted at the time the command is run.
4 |
5 | - Check filesystem /dev/sda, reporting any damaged blocks:
6 |
7 | `fsck {{/dev/sda}}`
8 |
9 | - Check filesystem /dev/sda, reporting any damaged blocks and interactively letting the user choose to repair each one:
10 |
11 | `fsck -r {{/dev/sda}}`
12 |
13 | - Check filesystem /dev/sda, reporting any damaged blocks and automatically repairing them:
14 |
15 | `fsck -a {{/dev/sda}}`
16 |
--------------------------------------------------------------------------------
/pages/common/nginx.md:
--------------------------------------------------------------------------------
1 | # nginx
2 |
3 | > Nginx web server.
4 |
5 | - Start server with default config:
6 |
7 | `nginx`
8 |
9 | - Start server with custom config file:
10 |
11 | `nginx -c {{config_file}}`
12 |
13 | - Start server with a prefix for all relative paths in config file:
14 |
15 | `nginx -c {{config_file}} -p {{prefix/for/relative/paths}}`
16 |
17 | - Test configuration without affecting the running server:
18 |
19 | `nginx -t`
20 |
21 | - Reload configuration by sending a signal with no downtime:
22 |
23 | `nginx -s reload`
24 |
--------------------------------------------------------------------------------
/pages/common/odps-func.md:
--------------------------------------------------------------------------------
1 | # odps func
2 |
3 | > Manage functions in ODPS (Open Data Processing Service).
4 |
5 | - Show functions in the current project:
6 |
7 | `list functions;`
8 |
9 | - Create a Java function using a .jar resource:
10 |
11 | `create function {{func_name}} as {{path.to.package.Func}} using '{{package.jar}}';`
12 |
13 | - Create a Python function using a .py resource:
14 |
15 | `create function {{func_name}} as {{script.Func}} using '{{script.py}}';`
16 |
17 | - Delete a function:
18 |
19 | `drop function {{func_name}};`
20 |
--------------------------------------------------------------------------------
/pages/common/test.md:
--------------------------------------------------------------------------------
1 | # test
2 |
3 | > Evaluate condition.
4 | > If it is true, returns 0 exit status, otherwise returns 1.
5 |
6 | - Test if given variable is equal to given string:
7 |
8 | `test $MY_VAR == '/bin/zsh'`
9 |
10 | - Test if given variable is empty:
11 |
12 | `test -z $GIT_BRANCH`
13 |
14 | - Test if file exists:
15 |
16 | `test -e {{filename}}`
17 |
18 | - Test if directory not exists:
19 |
20 | `test ! -d {{path/to/directory}}`
21 |
22 | - If-else statement:
23 |
24 | `test {{condition}} && echo "true" || echo "false"`
25 |
--------------------------------------------------------------------------------
/pages/osx/say.md:
--------------------------------------------------------------------------------
1 | # say
2 |
3 | > Converts text to speech.
4 |
5 | - Say a phrase aloud:
6 |
7 | `say {{"I like to ride my bike."}}`
8 |
9 | - Read a file aloud:
10 |
11 | `say -f {{filename.txt}}`
12 |
13 | - Say a phrase with a custom voice and speech rate:
14 |
15 | `say -v {{voice}} -r {{words_per_minute}} {{"I'm sorry Dave, I can't let you do that."}}`
16 |
17 | - List the available voices:
18 |
19 | `say -v ?`
20 |
21 | - Create an audio file of the spoken text:
22 |
23 | `say -o {{filename.aiff}} {{"Here's to the Crazy Ones."}}`
24 |
--------------------------------------------------------------------------------
/pages/sunos/prstat.md:
--------------------------------------------------------------------------------
1 | # prstat
2 |
3 | > Report active process statistics.
4 |
5 | - Examine all processes and reports statistics sorted by CPU usage:
6 |
7 | `prstat`
8 |
9 | - Examine all processes and reports statistics sorted by memory usage:
10 |
11 | `prstat -s rss`
12 |
13 | - Report total usage summary for each user:
14 |
15 | `prstat -t`
16 |
17 | - Report microstate process accounting information:
18 |
19 | `prstat -m`
20 |
21 | - Print out a list of top 5 cpu using processes every second:
22 |
23 | `prstat -c -n 5 -s cpu 1`
24 |
--------------------------------------------------------------------------------
/pages/sunos/svcadm.md:
--------------------------------------------------------------------------------
1 | # svcadm
2 |
3 | > Manipulate service instances.
4 |
5 | - Enable a service in the service database:
6 |
7 | `svcadm enable {{service_name}}`
8 |
9 | - Disable service:
10 |
11 | `svcadm disable {{service_name}}`
12 |
13 | - Restart a running service:
14 |
15 | `svcadm restart {{service_name}}`
16 |
17 | - Command service to re-read configuration files:
18 |
19 | `svcadm refresh {{service_name}}`
20 |
21 | - Clear a service from maintenance state and command it to start:
22 |
23 | `svcadm clear {{service_name}}`
24 |
--------------------------------------------------------------------------------
/pages/common/mv.md:
--------------------------------------------------------------------------------
1 | # mv
2 |
3 | > Move or rename files and directories.
4 |
5 | - Move files in arbitrary locations:
6 |
7 | `mv {{source}} {{target}}`
8 |
9 | - Do not prompt for confirmation before overwriting existing files:
10 |
11 | `mv -f {{source}} {{target}}`
12 |
13 | - Do not prompt for confirmation before overwriting existing files but write to standard error before overriding:
14 |
15 | `mv -fi {{source}} {{target}}`
16 |
17 | - Move files in verbose mode, showing files after they are moved:
18 |
19 | `mv -v {{source}} {{target}}`
20 |
--------------------------------------------------------------------------------
/pages/linux/lsb_release.md:
--------------------------------------------------------------------------------
1 | # lsb_release
2 |
3 | > Provides certain LSB (Linux Standard Base) and distribution-specific information.
4 |
5 | - Print all available information:
6 |
7 | `lsb_release -a`
8 |
9 | - Print a description (usually the full name) of the operating system:
10 |
11 | `lsb_release -d`
12 |
13 | - Print only the operating system name (ID), suppressing the field name:
14 |
15 | `lsb_release -i -s`
16 |
17 | - Print the release number and codename of the distribution, suppressing the field names:
18 |
19 | `lsb_release -rcs`
20 |
--------------------------------------------------------------------------------
/pages/common/csvcut.md:
--------------------------------------------------------------------------------
1 | # csvcut
2 |
3 | > Filter and truncate CSV files. Like Unix's `cut` command, but for tabular data.
4 | > Included in csvkit.
5 |
6 | - Print indices and names of all columns:
7 |
8 | `csvcut -n {{data.csv}}`
9 |
10 | - Extract the first and third columns:
11 |
12 | `csvcut -c {{1,3}} {{data.csv}}`
13 |
14 | - Extract all columns **except** the fourth one:
15 |
16 | `csvcut -C {{4}} {{data.csv}}`
17 |
18 | - Extract the columns named "id" and "first name" (in that order):
19 |
20 | `csvcut -c {{id,"first name"}} {{data.csv}}`
21 |
--------------------------------------------------------------------------------
/pages/common/odps-inst.md:
--------------------------------------------------------------------------------
1 | # odps inst
2 |
3 | > Manage instances in ODPS (Open Data Processing Service).
4 |
5 | - Show instances created by current user:
6 |
7 | `show instances;`
8 |
9 | - Describe the details of an instance:
10 |
11 | `desc instance {{instance_id}};`
12 |
13 | - Check the status of an instance:
14 |
15 | `status {{instance_id}};`
16 |
17 | - Wait on the termination of an instance, printing log and progress information until then:
18 |
19 | `wait {{instance_id}};`
20 |
21 | - Kill an instance:
22 |
23 | `kill {{instance_id}};`
24 |
--------------------------------------------------------------------------------
/pages/common/renice.md:
--------------------------------------------------------------------------------
1 | # renice
2 |
3 | > Alters the scheduling priority/nicenesses of one or more running processes. Niceness values range from -20 (most favorable to the process) to 19 (least favorable to the process).
4 |
5 | - Change priority of a running process:
6 |
7 | `renice -n {{niceness_value}} -p {{pid}}`
8 |
9 | - Change priority of all processes owned by a user:
10 |
11 | `renice -n {{niceness_value}} -u {{user}}`
12 |
13 | - Change priority of all processes that belongs to a group:
14 |
15 | `renice -n {{niceness_value}} -g {{group}}`
16 |
--------------------------------------------------------------------------------
/pages/common/vagrant.md:
--------------------------------------------------------------------------------
1 | # vagrant
2 |
3 | > Manage lightweight, reproducible, and portable development environments.
4 |
5 | - Create Vagrantfile in current folder with the base Vagrant box:
6 |
7 | `vagrant init`
8 |
9 | - Create Vagrantfile with the Ubuntu 14.04 (Trusty Tahr) box from HashiCorp Atlas:
10 |
11 | `vagrant init ubuntu/trusty32`
12 |
13 | - Start and provision the vagrant environment:
14 |
15 | `vagrant up`
16 |
17 | - Suspend the machine:
18 |
19 | `vagrant suspend`
20 |
21 | - Connect to machine via SSH:
22 |
23 | `vagrant ssh`
24 |
--------------------------------------------------------------------------------
/pages/common/ufraw-batch.md:
--------------------------------------------------------------------------------
1 | # ufraw-batch
2 |
3 | > Convert RAW files from cameras into standard image files.
4 |
5 | - Simply convert RAW files to jpg:
6 |
7 | `ufraw-batch --out-type=jpg {{input-file(s)}}`
8 |
9 | - Simply convert RAW files to png:
10 |
11 | `ufraw-batch --out-type=png {{input-file(s)}}`
12 |
13 | - Extract the preview image from the raw file:
14 |
15 | `ufraw-batch --embedded-image {{input-file(s)}}`
16 |
17 | - Save the file with size up to the given maximums MAX1 and MAX2:
18 |
19 | `ufraw-batch --size=MAX1,MAX2 {{input-file(s)}}`
20 |
--------------------------------------------------------------------------------
/pages/linux/apt-cache.md:
--------------------------------------------------------------------------------
1 | # apt-cache
2 |
3 | > Debian and Ubuntu package query tool.
4 |
5 | - Search for a package in your current sources:
6 |
7 | `apt-cache search {{query}}`
8 |
9 | - Show information about a package:
10 |
11 | `apt-cache show {{package}}`
12 |
13 | - Show whether a package is installed and up to date:
14 |
15 | `apt-cache policy {{package}}`
16 |
17 | - Show dependencies for a package:
18 |
19 | `apt-cache depends {{package}}`
20 |
21 | - Show packages that depend on a particular package:
22 |
23 | `apt-cache rdepends {{package}}`
24 |
--------------------------------------------------------------------------------
/pages/osx/brew.md:
--------------------------------------------------------------------------------
1 | # brew
2 |
3 | > Package manager for OS X.
4 |
5 | - Search formula:
6 |
7 | `brew search {{text}}`
8 |
9 | - Install formula:
10 |
11 | `brew install {{formula}}`
12 |
13 | - List installed formulae [with matching name]:
14 |
15 | `brew list {{[text]}}`
16 |
17 | - Get latest version of installed formula (passing no formula updates all installed formulae):
18 |
19 | `brew upgrade {{[formula]}}`
20 |
21 | - Update brew:
22 |
23 | `brew update`
24 |
25 | - Switch version of formula:
26 |
27 | `brew switch {{formula}} {{version}}`
28 |
--------------------------------------------------------------------------------
/pages/common/git-rebase.md:
--------------------------------------------------------------------------------
1 | # git rebase
2 |
3 | > Apply local commits on top of another branch's history.
4 |
5 | - Rebase your local branch interactively with the latest changes in local master:
6 |
7 | `git rebase -i master`
8 |
9 | - Rebase your local branch interactively with the latest changes from upstream:
10 |
11 | `git fetch origin; git rebase -i origin/master`
12 |
13 | - Handle an active rebase merge failure, after editing conflicting file(s):
14 |
15 | `git rebase --continue`
16 |
17 | - Abort a rebase in-progress:
18 |
19 | `git rebase --abort`
20 |
--------------------------------------------------------------------------------
/pages/common/convert.md:
--------------------------------------------------------------------------------
1 | # convert
2 |
3 | > Imagemagick image conversion tool.
4 |
5 | - Convert an image from JPG to PNG:
6 |
7 | `convert {{image.jpg}} {{image.png}}`
8 |
9 | - Scale an image 50% it's original size:
10 |
11 | `convert {{image.png}} -resize 50% {{image2.png}}`
12 |
13 | - Scale an image keeping the original aspect ratio to a maximum dimension of 640x480:
14 |
15 | `convert {{image.png}} -resize 640x480 {{image2.png}}`
16 |
17 | - Horizontally append images:
18 |
19 | `convert {{image1.png}} {{image2.png}} {{image3.png}} +append {{image123.png}}`
20 |
--------------------------------------------------------------------------------
/pages/common/handbrakecli.md:
--------------------------------------------------------------------------------
1 | # HandBrakeCLI
2 |
3 | > Video conversion tool.
4 |
5 | - Convert a video file to MKV (AAC 160kbit audio and x264 CRF20 video):
6 |
7 | `HandBrakeCLI -i {{input.avi}} -o {{output.mkv}} -e x264 -q 20 -B 160`
8 |
9 | - Resize a video file to 320x240:
10 |
11 | `HandBrakeCLI -i {{input.mp4}} -o {{output.mp4} -w 320 -l 240`
12 |
13 | - List available presets:
14 |
15 | `HandBrakeCLI --preset-list`
16 |
17 | - Convert an AVI video to MP4 using the Android preset:
18 |
19 | `HandBrakeCLI --preset="Android" -i {{input.ext}} -o {{output.mp4}}`
20 |
--------------------------------------------------------------------------------
/pages/common/odps-resource.md:
--------------------------------------------------------------------------------
1 | # odps resource
2 |
3 | > Manage resources in ODPS (Open Data Processing Service).
4 |
5 | - Show resources in the current project:
6 |
7 | `list resources;`
8 |
9 | - Add file resource:
10 |
11 | `add file {{file_name}} as {{alias}};`
12 |
13 | - Add archive resource:
14 |
15 | `add archive {{archive.tar.gz}} as {{alias}};`
16 |
17 | - Add .jar resource:
18 |
19 | `add jar {{package.jar}};`
20 |
21 | - Add .py resource:
22 |
23 | `add py {{script.py}};`
24 |
25 | - Delete resource:
26 |
27 | `drop resource {{resource_name}};`
28 |
--------------------------------------------------------------------------------
/pages/common/tree.md:
--------------------------------------------------------------------------------
1 | # tree
2 |
3 | > Show the contents of the current directory as a tree.
4 |
5 | - Show files and directories with a depth of 'num' (where 1 means the current directory):
6 |
7 | `tree -L {{num}}`
8 |
9 | - Show directories only:
10 |
11 | `tree -d`
12 |
13 | - Show hidden files too:
14 |
15 | `tree -a`
16 |
17 | - Print human readable size of files:
18 |
19 | `tree -h`
20 |
21 | - Print the full path for each file:
22 |
23 | `tree -f`
24 |
25 | - Print the tree without lines and indentation. Useful when used with -f:
26 |
27 | `tree -i`
28 |
--------------------------------------------------------------------------------
/pages/osx/top.md:
--------------------------------------------------------------------------------
1 | # top
2 |
3 | > Display dynamic real-time information about running processes.
4 |
5 | - Start top, all options are available in the interface:
6 |
7 | `top`
8 |
9 | - Start top sorting processes by internal memory size (default order - process ID):
10 |
11 | `top -o mem`
12 |
13 | - Start top sorting processes first by CPU, then by running time:
14 |
15 | `top -o cpu -O time`
16 |
17 | - Start top displaying only processes owned by given user:
18 |
19 | `top -user {{user-name}}`
20 |
21 | - Get help about interactive commands:
22 |
23 | `?`
24 |
--------------------------------------------------------------------------------
/pages/osx/wacaw.md:
--------------------------------------------------------------------------------
1 | # wacaw
2 |
3 | > A little command-line tool for Mac OS X that allows you to capture both still pictures and video from an attached camera.
4 |
5 | - Take a picture from webcam:
6 |
7 | `wacaw {{filename}}`
8 |
9 | - Record a video:
10 |
11 | `wacaw --video {{filename}} -D {{duration_in_seconds}}`
12 |
13 | - Take a picture with custom resolution:
14 |
15 | `wacaw -x {{width}} -y {{height}} {{filename}}`
16 |
17 | - Copy image just taken to clipboard:
18 |
19 | `wacaw --to-clipboard`
20 |
21 | - List the devices available:
22 |
23 | `wacaw -L`
24 |
--------------------------------------------------------------------------------
/pages/common/pip.md:
--------------------------------------------------------------------------------
1 | # pip
2 |
3 | > Python package manager.
4 |
5 | - Install a package:
6 |
7 | `pip install {{package_name}}`
8 |
9 | - Install a specific version of a package:
10 |
11 | `pip install {{package_name}}=={{package_version}}`
12 |
13 | - Upgrade a package:
14 |
15 | `pip install -U {{package_name}}`
16 |
17 | - Uninstall a package:
18 |
19 | `pip uninstall {{package_name}}`
20 |
21 | - Save installed packages to file:
22 |
23 | `pip freeze > {{requirements.txt}}`
24 |
25 | - Install packages from file:
26 |
27 | `pip install -r {{requirements.txt}}`
28 |
--------------------------------------------------------------------------------
/pages/common/uname.md:
--------------------------------------------------------------------------------
1 | # uname
2 |
3 | > Print details about the current machine and the operating system running on it.
4 | > Note: If you're on Linux, try also the `lsb_release` command.
5 |
6 | - Print hardware-related information: machine and processor:
7 |
8 | `uname -mp`
9 |
10 | - Print software-related information: operating system, release number, and version:
11 |
12 | `uname -srv`
13 |
14 | - Print the nodename (hostname) of the system:
15 |
16 | `uname -n`
17 |
18 | - Print all available system information (hardware, software, nodename):
19 |
20 | `uname -a`
21 |
--------------------------------------------------------------------------------
/pages/common/clang.md:
--------------------------------------------------------------------------------
1 | # clang
2 |
3 | > Compiler for C, C++, and Objective-C source files. Can be used as a drop-in replacement for GCC.
4 |
5 | - Compile a source code file into an executable binary:
6 |
7 | `clang {{input_source.c}} -o {{output_executable}}`
8 |
9 | - Activate output of all errors and warnings:
10 |
11 | `clang {{input_source.c}} -Wall -o {{output_executable}}`
12 |
13 | - Include libraries located at a different path than the source file:
14 |
15 | `clang {{input_source.c}} -o {{output_executable}} -I{{header_path}} -L{{library_path}} -l{{library_name}}`
16 |
--------------------------------------------------------------------------------
/pages/common/env.md:
--------------------------------------------------------------------------------
1 | # env
2 |
3 | > Show the environment or run a program in a modified environment.
4 |
5 | - Show the environment:
6 |
7 | `env`
8 |
9 | - Run a program. Often used in scripts after the shebang (#!) for looking up the path to the program:
10 |
11 | `env {{program}}`
12 |
13 | - Clear the environment and run a program:
14 |
15 | `env -i {{program}}`
16 |
17 | - Remove variable from the environment and run a program:
18 |
19 | `env -u {{variable}} {{program}}`
20 |
21 | - Set a variable and run a program:
22 |
23 | `env {{variable}}={{value}} {{program}}`
24 |
--------------------------------------------------------------------------------
/pages/common/ionice.md:
--------------------------------------------------------------------------------
1 | # ionice
2 |
3 | > Get or set program I/O scheduling class and priority.
4 | > Scheduling classes: 1 (realtime), 2 (best-effort), 3 (idle).
5 | > Priority levels: 0 (the highest) - 7 (the lowest).
6 |
7 | - Set I/O scheduling class of a running process:
8 |
9 | `ionice -c {{scheduling_class}} -p {{pid}}`
10 |
11 | - Run a command with custom I/O scheduling class and priority:
12 |
13 | `ionice -c {{scheduling_class}} -n {{priority}} {{command}}`
14 |
15 | - Print the I/O scheduling class and priority of a running process:
16 |
17 | `ionice -p {{pid}}`
18 |
--------------------------------------------------------------------------------
/pages/common/mocha.md:
--------------------------------------------------------------------------------
1 | # mocha
2 |
3 | > Execute Mocha JavaScript test runner.
4 |
5 | - Run tests with default configuration or as configured in `mocha.opts`:
6 |
7 | `mocha`
8 |
9 | - Run tests contained at a specific location:
10 |
11 | `mocha {{folder/with/tests}}`
12 |
13 | - Run tests that match a specific grep pattern:
14 |
15 | `mocha --grep {{^regex$}}`
16 |
17 | - Run tests on changes to JavaScript files in the current directory and once initially:
18 |
19 | `mocha --watch`
20 |
21 | - Run tests with a specific reporter:
22 |
23 | `mocha --reporter {{reporter}}`
24 |
--------------------------------------------------------------------------------
/pages/common/aria2c.md:
--------------------------------------------------------------------------------
1 | # aria2c
2 |
3 | > Fast download utility.
4 | > Supports HTTP(S), FTP, SFTP, BitTorrent, and Metalink.
5 |
6 | - Download a URI to a file:
7 |
8 | `aria2c {{url}}`
9 |
10 | - Download from multiple sources:
11 |
12 | `aria2c {{url_1}} {{url_2}}`
13 |
14 | - Download the URIs listed in a file:
15 |
16 | `aria2c -i {{filename}}`
17 |
18 | - Download with multiple connections:
19 |
20 | `aria2c -s {{connections_num}} {{url}}`
21 |
22 | - FTP download with username and password:
23 |
24 | `aria2c --ftp-user={{username}} --ftp-passwd={{password}} {{url}}`
25 |
--------------------------------------------------------------------------------
/pages/common/git-push.md:
--------------------------------------------------------------------------------
1 | # git push
2 |
3 | > Push commits to a remote repository.
4 |
5 | - Publish local changes on a remote branch:
6 |
7 | `git push {{REMOTE-NAME}} {{LOCAL-BRANCH}}`
8 |
9 | - Publish local changes on a remote branch of different name:
10 |
11 | `git push {{REMOTE-NAME}} {{LOCAL-BRANCH}}:{{REMOTE-BRANCH}}`
12 |
13 | - Remove remote branch:
14 |
15 | `git push {{REMOTE-NAME}} :{{REMOTE-BRANCH}}`
16 |
17 | - Remove remote branches which don't exist locally:
18 |
19 | `git push --prune {{REMOTE-NAME}}`
20 |
21 | - Publish tags:
22 |
23 | `git push --tags`
24 |
--------------------------------------------------------------------------------
/pages/common/pg_dump.md:
--------------------------------------------------------------------------------
1 | # pg_dump
2 |
3 | > Extract a PostgreSQL database into a script file or other archive file.
4 |
5 | - Dump database into a SQL-script file:
6 |
7 | `pg_dump {{db_name}} > {{output_file.sql}}`
8 |
9 | - Same as above, customize username:
10 |
11 | `pg_dump -U {{username}} {{db_name}} > {{output_file.sql}}`
12 |
13 | - Same as above, customize host and port:
14 |
15 | `pg_dump -h {{host}} -p {{port}} {{db_name}} > {{output_file.sql}}`
16 |
17 | - Dump a database into a custom-format archive file:
18 |
19 | `pg_dump -Fc {{db_name}} > {{output_file.dump}}`
20 |
--------------------------------------------------------------------------------
/pages/linux/equery.md:
--------------------------------------------------------------------------------
1 | # equery
2 |
3 | > View information about Portage packages.
4 |
5 | - List all installed packages:
6 |
7 | `equery list '*'`
8 |
9 | - Search for installed packages in the Portage tree and in overlays:
10 |
11 | `equery list -po {{package_name}}`
12 |
13 | - List all packages that depend on a given package:
14 |
15 | `equery depends {{package_name}}`
16 |
17 | - List all packages that a given package depends on:
18 |
19 | `equery depgraph {{package_name}}`
20 |
21 | - List all files installed by a package:
22 |
23 | `equery files --tree {{package_name}}`
24 |
--------------------------------------------------------------------------------
/pages/linux/lsattr.md:
--------------------------------------------------------------------------------
1 | # lsattr
2 |
3 | > List file attributes on a Linux file system.
4 |
5 | - Display the attributes of the files in the current directory:
6 |
7 | `lsattr`
8 |
9 | - List the attributes of files in a particular path:
10 |
11 | `lsattr {{path}}`
12 |
13 | - List file attributes recursively in the current and subsequent directories:
14 |
15 | `lsattr -R`
16 |
17 | - Show attributes of all the files in the current directory, including hidden ones:
18 |
19 | `lsattr -a`
20 |
21 | - Display attributes of directories in the current directory:
22 |
23 | `lsattr -d`
24 |
--------------------------------------------------------------------------------
/pages/common/cordova.md:
--------------------------------------------------------------------------------
1 | # cordova
2 |
3 | > Mobile apps with HTML, CSS & JS.
4 |
5 | - Create a cordova project:
6 |
7 | `cordova create {{path}} {{package.name}} {{project.name}}`
8 |
9 | - Display the current workspace status:
10 |
11 | `cordova info`
12 |
13 | - Add a cordova platform:
14 |
15 | `cordova platform add {{platform}}`
16 |
17 | - Remove a cordova platform:
18 |
19 | `cordova platform remove {{platform}}`
20 |
21 | - Add a cordova plugin:
22 |
23 | `cordova plugin add {{pluginid}}`
24 |
25 | - Remove a cordova plugin:
26 |
27 | `cordova plugin remove {{pluginid}}`
28 |
--------------------------------------------------------------------------------
/pages/common/ls.md:
--------------------------------------------------------------------------------
1 | # ls
2 |
3 | > List directory contents.
4 |
5 | - List files one per line:
6 |
7 | `ls -1`
8 |
9 | - List all files, including hidden files:
10 |
11 | `ls -a`
12 |
13 | - Long format list (permissions, ownership, size and modification date) of all files:
14 |
15 | `ls -la`
16 |
17 | - Long format list with size displayed using human readable units (KB, MB, GB):
18 |
19 | `ls -lh`
20 |
21 | - Long format list sorted by size (descending):
22 |
23 | `ls -lS`
24 |
25 | - Long format list of all files, sorted by modification date (oldest first):
26 |
27 | `ls -ltr`
28 |
--------------------------------------------------------------------------------
/pages/common/odps-tunnel.md:
--------------------------------------------------------------------------------
1 | # odps tunnel
2 |
3 | > Data tunnel in ODPS (Open Data Processing Service).
4 |
5 | - Download table to local file:
6 |
7 | `tunnel download {{table_name}} {{file}};`
8 |
9 | - Upload local file to a table partition:
10 |
11 | `tunnel upload {{file}} {{table_name}}/{{partition_spec}};`
12 |
13 | - Upload table specifying field and record delimiters:
14 |
15 | `tunnel upload {{file}} {{table_name}} -fd {{field_delim}} -rd {{record_delim}};`
16 |
17 | - Upload table using multiple threads:
18 |
19 | `tunnel upload {{file}} {{table_name}} -threads {{num}};`
20 |
--------------------------------------------------------------------------------
/pages/common/ar.md:
--------------------------------------------------------------------------------
1 | # ar
2 |
3 | > Create, modify, and extract from archives (.a .so .o).
4 |
5 | - Extract all members from an archive:
6 |
7 | `ar -x {{libfoo.a}}`
8 |
9 | - List the members of an archive:
10 |
11 | `ar -t {{libfoo.a}}`
12 |
13 | - Replace or add files to an archive:
14 |
15 | `ar -r {{libfoo.a}} {{foo.o}} {{bar.o}} {{baz.o}}`
16 |
17 | - Insert an object file index (equivalent to using `ranlib`):
18 |
19 | `ar -s {{libfoo.a}}`
20 |
21 | - Create an archive with files and an accompanying object file index:
22 |
23 | `ar -rs {{libfoo.a}} {{foo.o}} {{bar.o}} {{baz.o}}`
24 |
--------------------------------------------------------------------------------
/pages/common/calibre-server.md:
--------------------------------------------------------------------------------
1 | # calibre-server
2 |
3 | > A server application that can be used to distribute ebooks over a network.
4 | > Ebooks must be imported into the library using the GUI or calibredb before.
5 | > Part of the Calibre ebook library.
6 |
7 | - Start a server to distribute ebooks. Access at http://localhost:8080:
8 |
9 | `calibre-server`
10 |
11 | - Start server on different port. Access at http://localhost:port:
12 |
13 | `calibre-server --port {{port}}`
14 |
15 | - Password protect the server:
16 |
17 | `calibre-server --username {{username}} --password {{password}}`
18 |
--------------------------------------------------------------------------------
/pages/common/chmod.md:
--------------------------------------------------------------------------------
1 | # chmod
2 |
3 | > Change the access permissions of a file or directory.
4 |
5 | - Give the (u)ser who owns a file the right to e(x)ecute it:
6 |
7 | `chmod u+x {{file}}`
8 |
9 | - Give the user rights to (r)ead and (w)rite to a file/directory:
10 |
11 | `chmod u+rw {{file}}`
12 |
13 | - Remove executable rights from the (g)roup:
14 |
15 | `chmod g-x {{file}}`
16 |
17 | - Give (a)ll users rights to read and execute:
18 |
19 | `chmod a+rx {{file}}`
20 |
21 | - Give (o)thers (not in the file owner's group) the same rights as the group:
22 |
23 | `chmod o=g {{file}}`
24 |
--------------------------------------------------------------------------------
/pages/common/csvstat.md:
--------------------------------------------------------------------------------
1 | # csvstat
2 |
3 | > Print descriptive statistics for all columns in a CSV file.
4 | > Included in csvkit.
5 |
6 | - Show all stats for all columns:
7 |
8 | `csvstat {{data.csv}}`
9 |
10 | - Show all stats for columns 2 and 4:
11 |
12 | `csvstat -c {{2,4}} {{data.csv}}`
13 |
14 | - Show sums for all columns:
15 |
16 | `csvstat --sum {{data.csv}}`
17 |
18 | - Show the max value length for column 3:
19 |
20 | `csvstat -c {{3}} --len {{data.csv}}`
21 |
22 | - Show the number of unique values in the "name" column:
23 |
24 | `csvstat -c {{name}} --unique {{data.csv}}`
25 |
--------------------------------------------------------------------------------
/pages/linux/dnf.md:
--------------------------------------------------------------------------------
1 | # dnf
2 |
3 | > Package management utility for RHEL, Feodra, and CentOS (replaces yum).
4 |
5 | - Synchronize list of packages and versions available. This should be run first, before running subsequent dnf commands:
6 |
7 | `dnf update`
8 |
9 | - Install a new package:
10 |
11 | `dnf install {{package}}`
12 |
13 | - Install a new package and assume yes to all questions:
14 |
15 | `dnf -y install {{package}}`
16 |
17 | - Remove a package:
18 |
19 | `dnf remove {{package}}`
20 |
21 | - Upgrade installed packages to newest available versions:
22 |
23 | `dnf upgrade`
24 |
--------------------------------------------------------------------------------
/pages/linux/top.md:
--------------------------------------------------------------------------------
1 | # top
2 |
3 | > Display dynamic real-time information about running processes.
4 |
5 | - Start top:
6 |
7 | `top`
8 |
9 | - Do not show any idle or zombie processes:
10 |
11 | `top -i`
12 |
13 | - Show only processes owned by given user:
14 |
15 | `top -u {{user_name}}`
16 |
17 | - Show only the processes with the given PID(s), passed as a comma-separated list. (Normally you wouldn't know PIDs off hand. This example picks the PIDs from the process name):
18 |
19 | `top -p $(pgrep -d ',' {{process_name}})`
20 |
21 | - Get help about interactive commands:
22 |
23 | `?`
24 |
--------------------------------------------------------------------------------
/pages/linux/unexpand.md:
--------------------------------------------------------------------------------
1 | # unexpand
2 |
3 | > Convert spaces to tabs.
4 |
5 | - Convert blanks in each file to tabs, writing to standard output:
6 |
7 | `unexpand {{file}}`
8 |
9 | - Convert blanks to tabs, reading from standard output:
10 |
11 | `unexpand`
12 |
13 | - Convert all blanks, instead of just initial blanks:
14 |
15 | `unexpand -a {{file}}`
16 |
17 | - Convert only leading sequences of blanks (overrides -a):
18 |
19 | `unexpand --first-only {{file}}`
20 |
21 | - Have tabs a certain number of characters apart, not 8 (enables -a):
22 |
23 | `unexpand -t {{number}} {{file}}`
24 |
--------------------------------------------------------------------------------
/pages/common/odps.md:
--------------------------------------------------------------------------------
1 | # odps
2 |
3 | > Aliyun ODPS (Open Data Processing Service) command line tool.
4 |
5 | - Start the command line with a custom configuration file:
6 |
7 | `odpscmd --config={{odps_config.ini}}`
8 |
9 | - Switch current project:
10 |
11 | `use {{project_name}};`
12 |
13 | - Show tables in the current project:
14 |
15 | `show tables;`
16 |
17 | - Describe a table:
18 |
19 | `desc {{table_name}};`
20 |
21 | - Show table partitions:
22 |
23 | `show partitions {{table_name}};`
24 |
25 | - Describe a partition:
26 |
27 | `desc {{table_name}} partition ({{partition_spec}});`
28 |
--------------------------------------------------------------------------------
/pages/common/svn.md:
--------------------------------------------------------------------------------
1 | # svn
2 |
3 | > Subversion command line client tool.
4 |
5 | - Check out a working copy from a repository:
6 |
7 | `svn co {{url/to/repository}}`
8 |
9 | - Bring changes from the repository into the working copy:
10 |
11 | `svn up`
12 |
13 | - Put files and directories under version control, scheduling them for addition to repository. They will be added in next commit:
14 |
15 | `svn add PATH...`
16 |
17 | - Send changes from your working copy to the repository:
18 |
19 | `svn ci -m {{commit log message}} {{[PATH...]}}`
20 |
21 | - Show detailed help:
22 |
23 | `svn help`
24 |
--------------------------------------------------------------------------------
/pages/linux/journalctl.md:
--------------------------------------------------------------------------------
1 | # journalctl
2 |
3 | > Query the systemd journal.
4 |
5 | - Show all messages from this boot:
6 |
7 | `journalctl -b`
8 |
9 | - Show all messages from last boot:
10 |
11 | `journalctl -b -1`
12 |
13 | - Follow new messages (like `tail -f` for traditional syslog):
14 |
15 | `journalctl -f`
16 |
17 | - Show all messages by a specific unit:
18 |
19 | `journalctl -u {{unit}}`
20 |
21 | - Show all messages by a specific process:
22 |
23 | `journalctl _PID={{pid}}`
24 |
25 | - Show all messages by a specific executable:
26 |
27 | `journalctl {{/path/to/executable}}`
28 |
--------------------------------------------------------------------------------
/pages/common/docker.md:
--------------------------------------------------------------------------------
1 | # docker
2 |
3 | > Manage Docker containers and images.
4 |
5 | - List of running docker containers:
6 |
7 | `docker ps`
8 |
9 | - List all docker containers (running and stopped):
10 |
11 | `docker ps -a`
12 |
13 | - Start a container:
14 |
15 | `docker start {{container}}`
16 |
17 | - Stop a container:
18 |
19 | `docker stop {{container}}`
20 |
21 | - Start a container from an image and get a shell inside of it:
22 |
23 | `docker run -it {{image}} bash`
24 |
25 | - Run a command inside of an already running container:
26 |
27 | `docker exec {{container}} {{command}}`
28 |
--------------------------------------------------------------------------------
/pages/common/quota.md:
--------------------------------------------------------------------------------
1 | # quota
2 |
3 | > Display users' disk space usage and allocated limits.
4 |
5 | - Show disk quotas for the current user:
6 |
7 | `quota`
8 |
9 | - Verbose output (also display quotas on filesystems where no storage is allocated):
10 |
11 | `quota -v`
12 |
13 | - Quiet output (only display quotas on filesystems where usage is over quota):
14 |
15 | `quota -q`
16 |
17 | - Print quotas for the groups of which the current user is a member:
18 |
19 | `quota -g`
20 |
21 | - Show disk quotas for another user (must be superuser to do this):
22 |
23 | `sudo quota -u {{username}}`
24 |
--------------------------------------------------------------------------------
/pages/common/skicka.md:
--------------------------------------------------------------------------------
1 | # skicka
2 |
3 | > Manage your Google Drive.
4 |
5 | - Upload a file/folder to Google Drive:
6 |
7 | `skicka upload {{path/to/local}} {{path/to/remote}}`
8 |
9 | - Download a file/folder from Google Drive:
10 |
11 | `skicka download {{path/to/remote}} {{path/to/local}}`
12 |
13 | - List files:
14 |
15 | `skicka ls {{path/to/folder}}`
16 |
17 | - Show amount of space used by children folders:
18 |
19 | `skicka du {{path/to/parent/folder}}`
20 |
21 | - Create a folder:
22 |
23 | `skicka mkdir {{path/to/folder}}`
24 |
25 | - Delete a file:
26 |
27 | `skicka rm {{path/to/file}}`
28 |
--------------------------------------------------------------------------------
/pages/common/srm.md:
--------------------------------------------------------------------------------
1 | # srm
2 |
3 | > Securely remove files or directories.
4 | > Overwrites the existing data one or multiple times. Drop in replacement for rm.
5 |
6 | - Remove a file after a single-pass overwriting with random data:
7 |
8 | `srm -s {{/path/to/file}}`
9 |
10 | - Remove a file after seven passes of overwriting with random data:
11 |
12 | `srm -m {{/path/to/file}}`
13 |
14 | - Recursively remove a directory and its contents overwriting each file with a single-pass of random data:
15 |
16 | `srm -r -s {{/path/to/folder}}`
17 |
18 | - Prompt before every removal:
19 |
20 | `srm -i {{\*}}`
21 |
--------------------------------------------------------------------------------
/pages/common/zip.md:
--------------------------------------------------------------------------------
1 | # zip
2 |
3 | > Package and compress (archive) files into zip file.
4 |
5 | - Package and compress multiple directories and files:
6 |
7 | `zip -r {{compressed.zip}} {{/path/to/dir1 /path/to/dir2 /path/to/file}}`
8 |
9 | - Add files to an existing zip file:
10 |
11 | `zip {{compressed.zip}} {{path/to/file}}`
12 |
13 | - Remove unwanted files from an existing zip file:
14 |
15 | `zip -d {{compressed.zip}} "{{foo/*.tmp}}"`
16 |
17 | - Exclude unwanted files from being added to the compressed archive:
18 |
19 | `zip -r {{compressed.zip}} {{path/to/dir}} -x \*.git\* \*node_modules\* ...`
20 |
--------------------------------------------------------------------------------
/pages/linux/rpm.md:
--------------------------------------------------------------------------------
1 | # rpm
2 |
3 | > RPM Package Manager.
4 |
5 | - Show version of httpd package:
6 |
7 | `rpm -q {{httpd}}`
8 |
9 | - List versions of all matching packages:
10 |
11 | `rpm -qa '{{mariadb*}}'`
12 |
13 | - Identify owner of a file and show version of the package:
14 |
15 | `rpm -qf {{/etc/postfix/main.cf}}`
16 |
17 | - List package-owned files:
18 |
19 | `rpm -ql {{kernel}}`
20 |
21 | - Show scriptlets from an RPM file:
22 |
23 | `rpm -qp --scripts {{some.rpm}}`
24 |
25 | - Show changed, missing and/or incorrectly installed files of matching packages:
26 |
27 | `rpm -Va '{{php-*}}'`
28 |
--------------------------------------------------------------------------------
/pages/osx/xattr.md:
--------------------------------------------------------------------------------
1 | # xattr
2 |
3 | > Utility to work with extended filesystem attributes.
4 |
5 | - List key:value extended attributes for a given file:
6 |
7 | `xattr -l {{file}}`
8 |
9 | - Write an attribute for a given file:
10 |
11 | `xattr -w {{attribute_key}} {{attribute_value}} {{file}}`
12 |
13 | - Delete an attribute from a given file:
14 |
15 | `xattr -d {{attribute_key}} {{file}}`
16 |
17 | - Delete all extended attributes from a given file:
18 |
19 | `xattr -c {{file}}`
20 |
21 | - Recursively delete an attribute in a given directory:
22 |
23 | `xattr -rd {{attribute_key}} {{directory}}`
24 |
--------------------------------------------------------------------------------
/pages/common/bmaptool.md:
--------------------------------------------------------------------------------
1 | # bmaptool
2 |
3 | > Create or Copy blockmaps intelligently (and therefore faster than `cp` or `dd`).
4 |
5 | - Create a blockmap from image file:
6 |
7 | `bmaptool create -o {{blockmap.bmap}} {{source.img}}`
8 |
9 | - Copy an image file into sdb:
10 |
11 | `bmaptool copy --bmap {{blockmap.bmap}} {{source.img}} {{/dev/sdb}}`
12 |
13 | - Copy a compressed image file into sdb:
14 |
15 | `bmaptool copy --bmap {{blockmap.bmap}} {{source.img.gz}} {{/dev/sdb}}`
16 |
17 | - Copy an image file into sdb without using a blockmap:
18 |
19 | `bmaptool copy --nobmap {{source.img}} {{/dev/sdb}}`
20 |
--------------------------------------------------------------------------------
/pages/common/csvformat.md:
--------------------------------------------------------------------------------
1 | # csvformat
2 |
3 | > Convert a CSV file to a custom output format.
4 | > Included in csvkit.
5 |
6 | - Convert to a tab-delimited file (TSV):
7 |
8 | `csvformat -T {{data.csv}}`
9 |
10 | - Convert delimiters to a custom character:
11 |
12 | `csvformat -D "{{custom_character}}" {{data.csv}}`
13 |
14 | - Convert line endings to carriage return (^M) + line feed:
15 |
16 | `csvformat -M "{{\r\n}}" {{data.csv}}`
17 |
18 | - Minimize use of quote characters:
19 |
20 | `csvformat -U 0 {{data.csv}}`
21 |
22 | - Maximize use of quote characters:
23 |
24 | `csvformat -U 1 {{data.csv}}`
25 |
--------------------------------------------------------------------------------
/pages/common/git-stash.md:
--------------------------------------------------------------------------------
1 | # git stash
2 |
3 | > Stash local Git changes in a temporary area.
4 |
5 | - Stash current changes (except new files):
6 |
7 | `git stash save {{optional_stash_name}}`
8 |
9 | - Include new files in the stash (leaves the index completely clean):
10 |
11 | `git stash save -u {{optional_stash_name}}`
12 |
13 | - List all stashes:
14 |
15 | `git stash list`
16 |
17 | - Re-apply the latest stash:
18 |
19 | `git stash pop`
20 |
21 | - Re-apply a stash by name:
22 |
23 | `git stash apply {{stash_name}}`
24 |
25 | - Drop a stash by an index:
26 |
27 | `git stash drop stash@{index}`
28 |
--------------------------------------------------------------------------------
/pages/common/transcode.md:
--------------------------------------------------------------------------------
1 | # transcode
2 |
3 | > Suite of command line utilities for transcoding video and audio codecs.
4 | > And converting between formats.
5 |
6 | - Create stabilisation file to be able to remove camera shakes:
7 |
8 | `transcode -J stabilize -i {{inputfile}}`
9 |
10 | - Remove camera shakes after creating stabilisation file, transform video using xvid:
11 |
12 | `transcode -J transform -i {{inputfile}} -y xvid -o {{outputfile}}`
13 |
14 | - Resize the video to 640x480 pixels and convert to MPEG4 codec using xvid:
15 |
16 | `transcode -Z 640x480 -i {{inputfile}} -y xvid -o {{outputfile}}`
17 |
--------------------------------------------------------------------------------
/pages/common/last.md:
--------------------------------------------------------------------------------
1 | # last
2 |
3 | > View the last logged in users.
4 |
5 | - View last logins, their duration and other information as read from /var/log/wtmp:
6 |
7 | `last`
8 |
9 | - Specify how many of the last logins to show:
10 |
11 | `last -n {{login_count}}`
12 |
13 | - View full login times and dates:
14 |
15 | `last -F`
16 |
17 | - View the last login by a specific user:
18 |
19 | `last {{user_name}}`
20 |
21 | - View the last reboot (last login of the pseudo user reboot):
22 |
23 | `last reboot`
24 |
25 | - View the last shutdown (last login of the pseudo user shutdown):
26 |
27 | `last shutdown`
28 |
--------------------------------------------------------------------------------
/pages/common/slackcat.md:
--------------------------------------------------------------------------------
1 | # slackcat
2 |
3 | > Utility for passing files and command output to Slack.
4 |
5 | - Post a file to Slack:
6 |
7 | `slackcat --channel {{channel_name}} {{path/to/file}}`
8 |
9 | - Post a file to Slack with a custom filename:
10 |
11 | `slackcat --channel {{channel_name}} --filename={{filename}} {{path/to/file}}`
12 |
13 | - Pipe command output to Slack as a text snippet:
14 |
15 | `{{command}} | slackcat --channel {{channel_name}} --filename={{snippet_name}}`
16 |
17 | - Stream command output to Slack continuously:
18 |
19 | `{{command}} | slackcat --channel {{channel_name}} --stream`
20 |
--------------------------------------------------------------------------------
/pages/osx/dd.md:
--------------------------------------------------------------------------------
1 | # dd
2 |
3 | > Convert and copy a file.
4 |
5 | - Make a bootable usb drive from an isohybrid file (such like archlinux-xxx.iso):
6 |
7 | `dd if={{file.iso}} of=/dev/{{usb_drive}}`
8 |
9 | - Clone a drive to another drive with 4MB block and ignore error:
10 |
11 | `dd if=/dev/{{source_drive}} of=/dev/{{dest_drive}} bs=4m conv=noerror`
12 |
13 | - Generate a file of 100 random bytes by using kernel random driver:
14 |
15 | `dd if=/dev/urandom of={{random_file}} bs=100 count=1`
16 |
17 | - Benchmark the write performance of a disk:
18 |
19 | `dd if=/dev/zero of={{file_1GB}} bs=1024 count=1000000`
20 |
--------------------------------------------------------------------------------
/pages/common/7za.md:
--------------------------------------------------------------------------------
1 | # 7za
2 |
3 | > A file archiver with high compression ratio.
4 |
5 | - Compress directory or file:
6 |
7 | `7za a {{compressed.7z}} {{directory_or_file_to_compress}}`
8 |
9 | - Decompress an existing 7z file with original directory structure:
10 |
11 | `7za x {{compressed.7z}}`
12 |
13 | - Compress to zip format:
14 |
15 | `7za a -tzip {{compressed.zip}} {{directory_or_file_to_compress}}`
16 |
17 | - Create multipart 7zip file; `part_size` specifies part size in Bytes, Kilobytes, Megabytes or Gigabytes:
18 |
19 | `7za -v{{part_size}}{{[b|k|m|g]}} {{compressed.7z}} {{directory_or_file_to_compress}}`
20 |
--------------------------------------------------------------------------------
/pages/common/sass.md:
--------------------------------------------------------------------------------
1 | # Sass
2 |
3 | > Converts SCSS or Sass files to CSS.
4 |
5 | - Output converted file to stdout:
6 |
7 | `sass {{inputfile.(scss|sass)}}`
8 |
9 | - Immediately convert SCSS or Sass file to CSS to specified output file:
10 |
11 | `sass {{inputfile.(scss|sass)}} {{outputfile.css}}`
12 |
13 | - Watch SCSS or Sass file for changes and output or update CSS file with same filename:
14 |
15 | `sass --watch {{inputfile.(scss|sass)}}`
16 |
17 | - Watch SCSS or Sass file for changes and output or update CSS file with specified filename:
18 |
19 | `sass --watch {{inputfile.(scss|sass)}}:{{outputfile.css}}`
20 |
--------------------------------------------------------------------------------
/pages/linux/umask.md:
--------------------------------------------------------------------------------
1 | # umask
2 |
3 | > Manage the read/write/execute permissions that are masked out (i.e. restricted) for newly created files by the user.
4 |
5 | - Display the current mask in octal notation:
6 |
7 | `umask`
8 |
9 | - Display the current mask in symbolic (human-readable) mode:
10 |
11 | `umask -S`
12 |
13 | - Change the mask symbolically to allow read permission for all users (the rest of the mask bits are unchanged):
14 |
15 | `umask {{a+r}}`
16 |
17 | - Set the mask (using octal) to restrict no permissions for the file's owner, and restrict all permissions for everyone else:
18 |
19 | `umask {{077}}`
20 |
--------------------------------------------------------------------------------
/pages/common/printf.md:
--------------------------------------------------------------------------------
1 | # printf
2 |
3 | > Format and print text.
4 |
5 | - Print a text message:
6 |
7 | `printf {{"%s\n"}} {{"Hello world"}}`
8 |
9 | - Print an integer in bold blue:
10 |
11 | `printf {{"\e[1;34m%.3d\e[0m\n"}} {{42}}`
12 |
13 | - Print a float number with the unicode Euro sign:
14 |
15 | `printf {{"\u20AC %.2f\n"}} {{123.4}}`
16 |
17 | - Print a text message composed with environment variables:
18 |
19 | `printf {{"var1: %s\tvar2: %s\n"}} {{"$VAR1"}} {{"$VAR2"}}`
20 |
21 | - Store a formatted message in a variable (does not work on zsh):
22 |
23 | `printf -v {{myvar}} {{"This is %s = %d\n" "a year" 2016}}`
24 |
--------------------------------------------------------------------------------
/pages/linux/netstat.md:
--------------------------------------------------------------------------------
1 | # netstat
2 |
3 | > Displays various networks related information such as open connections, open socket ports etc.
4 |
5 | - List all ports:
6 |
7 | `netstat -a`
8 |
9 | - List all listening ports:
10 |
11 | `netstat -l`
12 |
13 | - List listening TCP ports:
14 |
15 | `netstat -t`
16 |
17 | - Display PID and program names:
18 |
19 | `netstat -p`
20 |
21 | - List information continuously:
22 |
23 | `netstat -c`
24 |
25 | - List routes and do not resolve IP to hostname:
26 |
27 | `netstat -rn`
28 |
29 | - List listening TCP and UDP ports (+ user and process if you're root):
30 |
31 | `netstat -lepunt`
32 |
--------------------------------------------------------------------------------
/pages/osx/networksetup.md:
--------------------------------------------------------------------------------
1 | # networksetup
2 |
3 | > Configuration tool for Network System Preferences.
4 |
5 | - List available network service providers (Ethernet, Wi-Fi, Bluetooth, etc):
6 |
7 | `networksetup -listallnetworkservices`
8 |
9 | - Show network settings for a particular networking device:
10 |
11 | `networksetup -getinfo {{"Wi-Fi"}}`
12 |
13 | - Get currently connected Wi-Fi network name (Wi-Fi device usually en0 or en1):
14 |
15 | `networksetup -getairportnetwork {{en0}}`
16 |
17 | - Connect to a particular Wi-Fi network:
18 |
19 | `networksetup -setairportnetwork {{en0}} {{"Airport Network SSID"}} {{password}}`
20 |
--------------------------------------------------------------------------------
/pages/common/read.md:
--------------------------------------------------------------------------------
1 | # read
2 |
3 | > BASH builtin for retrieving data from standard input.
4 |
5 | - Store data that you type from the keyboard:
6 |
7 | `read {{variable}}`
8 |
9 | - Store each of the next lines you enter as values of an array:
10 |
11 | `read -a {{array}}`
12 |
13 | - Enable backspace and GNU readline hotkeys when entering input with read:
14 |
15 | `read -e {{variable}}`
16 |
17 | - Specify the number of maximum characters to be read:
18 |
19 | `read -n {{character_count}} {{variable}}`
20 |
21 | - Use a specific character as a delimiter instead of a new line:
22 |
23 | `read -d {{new_delimiter}} {{variable}}`
24 |
--------------------------------------------------------------------------------
/pages/linux/du.md:
--------------------------------------------------------------------------------
1 | # du
2 |
3 | > Estimate file space usage.
4 |
5 | - Get a sum of the total size of a file/folder in human readable units:
6 |
7 | `du -sh {{file_or_directory}}`
8 |
9 | - List file sizes of a directory and any subdirectories in KB:
10 |
11 | `du -k {{file_or_directory}}`
12 |
13 | - List file sizes of a directory and any subdirectories in MB:
14 |
15 | `du -m {{file_or_directory}}`
16 |
17 | - Get recursively, individual file/folder sizes in human readable form:
18 |
19 | `du -ah {{directory}}`
20 |
21 | - List the KB sizes of directories for N levels below the specified directory:
22 |
23 | `du --max-depth=N`
24 |
--------------------------------------------------------------------------------
/pages/common/git-config.md:
--------------------------------------------------------------------------------
1 | # git config
2 |
3 | > Get and set repository or global options.
4 |
5 | - Print list of options for current repository:
6 |
7 | `git config --list --local`
8 |
9 | - Print global list of options, set in ~/.gitconfig:
10 |
11 | `git config --list --global`
12 |
13 | - Get full list of options:
14 |
15 | `git config --list`
16 |
17 | - Get value of alias.ls option:
18 |
19 | `git config alias.st`
20 |
21 | - Set option alias.ls=status in file ~/.gitconfig:
22 |
23 | `git config --global alias.ls "status"`
24 |
25 | - Remove option alias.st from ~/.gitconfig:
26 |
27 | `git config --global --unset alias.st`
28 |
--------------------------------------------------------------------------------
/pages/common/lp.md:
--------------------------------------------------------------------------------
1 | # lp
2 |
3 | > Print files.
4 |
5 | - Print the output of a command to the default printer (see `lpstat` command):
6 |
7 | `echo "test" | lp`
8 |
9 | - Print a file to the default printer:
10 |
11 | `lp {{path/to/filename}}`
12 |
13 | - Print a file to a named printer (see `lpstat` command):
14 |
15 | `lp -d {{printer_name}} {{path/to/filename}}`
16 |
17 | - Print N copies of file to default printer (replace N with desired number of copies):
18 |
19 | `lp -n {{N}} {{path/to/filename}}`
20 |
21 | - Print only certain pages to the default printer (print pages 1, 3-5, and 16):
22 |
23 | `lp -P 1,3-5,16 {{path/to/filename}}`
24 |
--------------------------------------------------------------------------------
/pages/common/mount.md:
--------------------------------------------------------------------------------
1 | # mount
2 |
3 | > Provides access to an entire filesystem in one directory.
4 |
5 | - Show all mounted filesystems:
6 |
7 | `mount`
8 |
9 | - Mount a device:
10 |
11 | `mount -t {{filesystem_type}} {{path_to_device_file}} {{directory_to_mount_to}}`
12 |
13 | - Mount a CD-ROM device (with the filetype ISO9660) to /cdrom (readonly):
14 |
15 | `mount -t {{iso9660}} -o ro {{/dev/cdrom}} {{/cdrom}}`
16 |
17 | - Mount all the filesystem defined in /etc/fstab:
18 |
19 | `mount -a`
20 |
21 | - Mount a specific filesystem described in /etc/fstab (e.g. "/dev/sda1 /my_drive ext2 defaults 0 2"):
22 |
23 | `mount {{/my_drive}}`
24 |
--------------------------------------------------------------------------------
/pages/osx/route.md:
--------------------------------------------------------------------------------
1 | # route
2 |
3 | > Manually manipulate the routing tables.
4 | > Necessitates to be root.
5 |
6 | - Add a route to a destination through a gateway:
7 |
8 | `sudo route add {{dest_ip_address}} {{gateway_address}}`
9 |
10 | - Add a route to a /24 subnet through a gateway:
11 |
12 | `sudo route add {{subnet_ip_address}}/24 {{gateway_address}}`
13 |
14 | - Run in test mode (does not do anything, just print):
15 |
16 | `sudo route -t add {{dest_ip_address}}/24 {{gateway_address}}`
17 |
18 | - Remove all routes:
19 |
20 | `sudo route flush`
21 |
22 | - Delete a specific route:
23 |
24 | `sudo route delete {{dest_ip_address}}/24`
25 |
--------------------------------------------------------------------------------
/pages/common/calibredb.md:
--------------------------------------------------------------------------------
1 | # calibredb
2 |
3 | > Tool to manipulate the your ebook database.
4 | > Part of the Calibre ebook library.
5 |
6 | - List ebooks in the library with additional information:
7 |
8 | `calibredb list`
9 |
10 | - Search for ebooks displaying additional information:
11 |
12 | `calibredb list --search {{search-term}}`
13 |
14 | - Search for just ids of ebooks:
15 |
16 | `calibredb search {{search term}}`
17 |
18 | - Add one or more ebooks to the library:
19 |
20 | `calibredb add {{file1 file2 …}}`
21 |
22 | - Remove one or more ebooks from the library. You need ebook-ids (see above):
23 |
24 | `calibredb remove {{id1 id2 …}}`
25 |
--------------------------------------------------------------------------------
/pages/common/enca.md:
--------------------------------------------------------------------------------
1 | # enca
2 |
3 | > Detect and convert encoding of text files.
4 |
5 | - Detect file(s) encoding according to your system's locale:
6 |
7 | `enca {{file(s)}}`
8 |
9 | - Detect file(s) encoding; -L option tells enca the current language; language is in the POSIX/C locale format, e.g. zh_CN, en_US etc:
10 |
11 | `enca -L {{language}} {{file(s)}}`
12 |
13 | - Convert file(s) to specified encoding:
14 |
15 | `enca -L {{language}} -x {{to_encoding}} {{file(s)}}`
16 |
17 | - Save original_file as new_file and convert new_file to specified encoding:
18 |
19 | `enca -L {{language}} -x {{to_encoding}} < {{original_file}} > {{new_file}}`
20 |
--------------------------------------------------------------------------------
/pages/common/ffmpeg.md:
--------------------------------------------------------------------------------
1 | # ffmpeg
2 |
3 | > Video conversion tool.
4 |
5 | - Extract the sound from a video and save it as MP3:
6 |
7 | `ffmpeg -i {{video-filename}} -vn -ar 44100 -ac 2 -ab 192 -f mp3 {{sound.mp3}}`
8 |
9 | - Convert frames from a video into individual numbered images:
10 |
11 | `ffmpeg -i {{video-filename}} {{image%d.png}}`
12 |
13 | - Combine numbered images (image1.jpg, image2.jpg, etc) into a video:
14 |
15 | `ffmpeg -f image2 -i {{image%d.jpg}} {{video.mpg}}`
16 |
17 | - Convert AVI video to MP4. AAC Audio @ 128kbit, Video @ 1250Kbit:
18 |
19 | `ffmpeg -i {{in.avi}} -acodec libfaac -ab 128k -vcodec mpeg4 -b 1250K {{out.mp4}}`
20 |
--------------------------------------------------------------------------------
/pages/common/mmv.md:
--------------------------------------------------------------------------------
1 | # mmv
2 |
3 | > Move and rename files in bulk.
4 |
5 | - Rename all files with a certain extension to a different extension:
6 |
7 | `mmv "*{{.old_extension}}" "#1{{.new_extension}}"`
8 |
9 | - Copy report6part4.txt to ./french/rapport6partie4.txt along with all similarly named files:
10 |
11 | `mmv -c {{"report*part*.txt"}} {{"./french/rapport#1partie#2.txt"}}`
12 |
13 | - Append all .txt files into one file:
14 |
15 | `mmv -a {{"*.txt"}} {{"all.txt"}}`
16 |
17 | - Convert dates in filenames from "M-D-Y" format to "D-M-Y" format:
18 |
19 | `mmv {{"[0-1][0-9]-[0-3][0-9]-[0-9][0-9][0-9][0-9].txt"}} {{"#3#4-#1#2-#5#6#7#8.txt"}}`
20 |
--------------------------------------------------------------------------------
/pages/common/uniq.md:
--------------------------------------------------------------------------------
1 | # uniq
2 |
3 | > Output the unique lines from the given input or file.
4 | > Since it does not detect repeated lines unless they are adjacent, we need to sort them first.
5 |
6 | - Display each line once:
7 |
8 | `sort {{file}} | uniq`
9 |
10 | - Display only unique lines:
11 |
12 | `sort {{file}} | uniq -u`
13 |
14 | - Display only duplicate lines:
15 |
16 | `sort {{file}} | uniq -d`
17 |
18 | - Display number of occurences of each line along with that line:
19 |
20 | `sort {{file}} | uniq -c`
21 |
22 | - Display number of occurences of each line, sorted by the most frequent:
23 |
24 | `sort {{file}} | uniq -c | sort -nr`
25 |
--------------------------------------------------------------------------------
/pages/linux/systemctl.md:
--------------------------------------------------------------------------------
1 | # systemctl
2 |
3 | > Control the systemd system and service manager.
4 |
5 | - List failed units:
6 |
7 | `systemctl --failed`
8 |
9 | - Start/Stop/Restart/Reload a service:
10 |
11 | `systemctl start/stop/restart/reload {{unit}}`
12 |
13 | - Show the status of a unit:
14 |
15 | `systemctl status {{unit}}`
16 |
17 | - Enable/Disable a unit to be started on bootup:
18 |
19 | `systemctl enable/disable {{unit}}`
20 |
21 | - Mask/Unmask a unit, prevent it to be started on bootup:
22 |
23 | `systemctl mask/unmask {{unit}}`
24 |
25 | - Reload systemd, scanning for new or changed units:
26 |
27 | `systemctl daemon-reload`
28 |
--------------------------------------------------------------------------------
/pages/linux/yaourt.md:
--------------------------------------------------------------------------------
1 | # yaourt
2 |
3 | > Arch Linux utility for building packages from the Arch User Repository.
4 |
5 | - Synchronize and update all packages (including AUR):
6 |
7 | `yaourt -Syua`
8 |
9 | - Install a new package (includes AUR):
10 |
11 | `yaourt -S package-name`
12 |
13 | - Remove a package and its dependencies (includes AUR packages):
14 |
15 | `yaourt -Rs package-name`
16 |
17 | - Search the package database for a keyword (including AUR):
18 |
19 | `yaourt -Ss package-name`
20 |
21 | - List installed packages, versions, and repositories (AUR packages will be listed under the repository name 'local'):
22 |
23 | `yaourt -Q`
24 |
--------------------------------------------------------------------------------
/pages/linux/yum.md:
--------------------------------------------------------------------------------
1 | # yum
2 |
3 | > Package management utility for RHEL, Feodra, and CentOS (for older versions).
4 |
5 | - Synchronize list of packages and versions available. This should be run first, before running subsequent yum commands:
6 |
7 | `yum update`
8 |
9 | - Install a new package:
10 |
11 | `yum install {{package}}`
12 |
13 | - Install a new package and assume yes to all questions (also works with update, great for automated updates):
14 |
15 | `yum -y install {{package}}`
16 |
17 | - Remove a package:
18 |
19 | `yum remove {{package}}`
20 |
21 | - Upgrade installed packages to newest available versions:
22 |
23 | `yum upgrade`
24 |
--------------------------------------------------------------------------------
/pages/common/ag.md:
--------------------------------------------------------------------------------
1 | # ag
2 |
3 | > The Silver Searcher. Like ack, but faster.
4 |
5 | - Find files containing "foo", and print the line matches in context:
6 |
7 | `ag foo`
8 |
9 | - Find files containing "foo", but only list the filenames:
10 |
11 | `ag -l foo`
12 |
13 | - Find files containing "FOO" case-insensitively, and print only the match, rather than the whole line:
14 |
15 | `ag -i -o FOO`
16 |
17 | - Find "foo" in files with a name matching "bar":
18 |
19 | `ag foo -G bar`
20 |
21 | - Find files whose contents match a regular expression:
22 |
23 | `ag '^ba(r|z)$'`
24 |
25 | - Find files with a name matching "foo":
26 |
27 | `ag -g foo`
28 |
--------------------------------------------------------------------------------
/pages/common/less.md:
--------------------------------------------------------------------------------
1 | # less
2 |
3 | > Opens a file for reading.
4 | > Allows movement and search.
5 | > Doesn't read the entire file (suitable for logs).
6 |
7 | - Open a file:
8 |
9 | `less {{source_file}}`
10 |
11 | - Page up / down:
12 |
13 | `d (next), D (previous)`
14 |
15 | - Go to start / end of file:
16 |
17 | `g (start), G (end)`
18 |
19 | - Forward search for a string:
20 |
21 | `/{{something}} then n (next), N (previous)`
22 |
23 | - Backward search for a string:
24 |
25 | `?{{something}} then n (next), N (previous)`
26 |
27 | - Enable output of ANSI colors:
28 |
29 | `git diff --color | less -R`
30 |
31 | - Exit:
32 |
33 | `q`
34 |
--------------------------------------------------------------------------------
/pages/common/lsof.md:
--------------------------------------------------------------------------------
1 | # lsof
2 |
3 | > Lists open files and the corresponding processes.
4 | > Note: In most cases, you need root privilege (or use sudo) because you want to list files opened by others.
5 |
6 | - Find the processes that have a given file open:
7 |
8 | `lsof {{/path/to/file}}`
9 |
10 | - Find the process that opened a local internet port:
11 |
12 | `lsof -i :{{port}}`
13 |
14 | - Only output the process PID:
15 |
16 | `lsof -t {{/path/to/file}}`
17 |
18 | - List files opened by the given user:
19 |
20 | `lsof -u {{username}}`
21 |
22 | - List files opened by the given command or process:
23 |
24 | `lsof -c {{process_or_command_name}}`
25 |
--------------------------------------------------------------------------------
/pages/linux/prt-get.md:
--------------------------------------------------------------------------------
1 | # prt-get
2 |
3 | > The advanced CRUX package manager.
4 |
5 | - Install a package:
6 |
7 | `prt-get install {{package-name}}`
8 |
9 | - Install a package with dependency handling:
10 |
11 | `prt-get depinst {{package-name}}`
12 |
13 | - Update a package manually:
14 |
15 | `prt-get upgrade {{package-name}}`
16 |
17 | - Remove a package:
18 |
19 | `prt-get remove {{package-name}}`
20 |
21 | - Upgrade the system from the local ports tree:
22 |
23 | `prt-get sysup`
24 |
25 | - Search the ports tree:
26 |
27 | `prt-get search {{package-name}}`
28 |
29 | - Search for a file in a package:
30 |
31 | `prt-get fsearch {{file}}`
32 |
--------------------------------------------------------------------------------
/pages/common/cp.md:
--------------------------------------------------------------------------------
1 | # cp
2 |
3 | > Copy files.
4 |
5 | - Copy files in arbitrary locations:
6 |
7 | `cp {{/path/to/original}} {{/path/to/copy}}`
8 |
9 | - Copy a file to a parent directory:
10 |
11 | `cp {{/path/to/original}} ../{{path/to/copy}}`
12 |
13 | - Copy directories recursive using the option -r:
14 |
15 | `cp -r {{/path/to/original}} {{/path/to/copy}}`
16 |
17 | - Show files as they are copied:
18 |
19 | `cp -vr {{/path/to/original}} {{/path/to/copy}}`
20 |
21 | - Make a copy of a file, adding an extension:
22 |
23 | `cp {{file.html}}{,.backup}`
24 |
25 | - Make a copy of a file, changing the extension:
26 |
27 | `cp {{file.}}{html,backup}`
28 |
--------------------------------------------------------------------------------
/pages/linux/apt-get.md:
--------------------------------------------------------------------------------
1 | # apt-get
2 |
3 | > Debian and Ubuntu package management utility.
4 |
5 | - Synchronize list of packages and versions available. This should be run first, before running subsequent apt-get commands:
6 |
7 | `apt-get update`
8 |
9 | - Install a new package:
10 |
11 | `apt-get install {{package}}`
12 |
13 | - Remove a package:
14 |
15 | `apt-get remove {{package}}`
16 |
17 | - Upgrade installed packages to newest available versions:
18 |
19 | `apt-get upgrade`
20 |
21 | - Upgrade installed packages (like "upgrade"), but remove obsolete packages and install additional packages to meet new dependencies:
22 |
23 | `apt-get dist-upgrade`
24 |
--------------------------------------------------------------------------------