Utility scripts for Unix(-like) operating systems.
Portable:
- fmtw:
fmt(1)
wrapper to rewrap text at a given line width. - fmtp:
fmt(1)
wrapper to rewrap text at a given line width while preserving a prefix (such as a comment token, e.g.,//
or#
). 80p is an alias forfmtp -w80
. - fmtbl:
fmt(1)
wrapper to rewrap bulleted lists at a given line width. 72bl and 80bl are aliases forfmtbl -w72
andfmtbl -w80
, respectively. - fmts: a "smart" wrapper around
fmtw
,fmtp
, andfmtbl
, which examines the input text and picks which script to use. 72 and 80 are aliases forfmts -w72
andfmts -w80
, respectively. - et:
expand(1)
wrapper; accepts optional file name arguments. - ut:
unexpand(1)
wrapper; accepts optional file name arguments. - c:
sed(1)
wrapper to comment-out lines. - uc:
sed(1)
wrapper to uncomment-out lines. - lower and upper are trivial
tr
wrappers to convert text to lowercase or uppercase. - i: indent text by one tab (default) or four spaces (with
-e
) or an arbitrary number of spaces (with-E n
). is is an alias fori -e
. - ui: unindent text by one level (by default, four spaces and/or one tab,
which works for either, as long as tabs don't follow spaces; also implements
-e
and-E n
options to unindent spaces only). - f: search for file names with fd or, if that's not available,
with
find(1)
. - s: recursively search file contents with rg, ag, or
grep(1)
, in that order of preference. - rd2u: recursively run
dos2unix(1)
on all files in a directory (and its subdirectories) which contain DOS newlines. - ci and cs are thin wrapper scripts for the
cindex
andcsearch
programs from codesearch. pci and pcs are variant wrapper scripts for using a project-specific index file. - mktag and tag are universal-ctag wrapper scripts.
mktag
generates thetags
file: if PWD is within a Git repository, it automatically finds the top-level directory in the repository and runsctags -R
from there.tag
is areadtag(1)
wrapper which converts the given tag intofilename:lineno
. - mkexe:
touch(1)
andchmod +x
paths in one command. - no9: remove
$PLAN9/bin
(see plan9port) from the$PATH
, if present, and run a command. - md2htm: use pandoc to convert a Markdown file to HTML and optionally open it in a web browser.
- ddiso:
dd(1)
wrapper for writing an ISO to a disk. - ddwipe:
dd(1)
wrapper for wiping a disk. - Git subcommand aliases: gita (
git add
), gitc (git commit
), gitca (git commit --amend
), gitcp (git cherry-pick
), gitd (git diff
), gitdc (git diff --cached
), gitp (git pull
), git1 (git show
), gits (git status
), gitu (git push
). - ssh-ak-add: safely append a public key to
$HOME/.ssh/authorized_keys
. - setpipefail: does
set -o pipefail
if the shell supports it (currently, support is assumed except for the Linux dash shell used by Debian-based distros). Does nothing useful on its own; it's meant to be sourced by other scripts. - zfs-health: Health check-up for systems running ZFS.
- Text editor wrapper scripts which implement partial support for
.editorconfig files:
- nano-wrapper for GNU nano; also has an extra rule for Git commit messages.
- sam-wrapper for Sam.
- godit-wrapper for (my fork of) godit.
- vol: Volume (audio) control.
- mic: Enable or disable the microphone.
- bl: Backlight brightness control.
- nix-zsh: nix-shell(1) wrapper script which adds
--run zsh
to the command-line parameters.
Linux-specific:
install.sh creates symbolic links in $HOME/bin
for the scripts
in this repository.