Terminal Tools
Table of Contents
Just some notes on tools I frequently use in the terminal.
ffmpeg#
Converting MKV to MP4#
Sometimes I take screen recordings and post them on GitLab for my team to reference. I use OBS which by default saves recordings to MKV files, but they display better in GitLab as MP4 files. This a command to convert MKV files to MP4 files:
ffmpeg -i input.mkv -c:v libx264 -c:a aac output.mp4
git#
Displaying last touched branches#
I tend to create a lot of prototyping branches for features I’m working on, especially ones that require more complex implementations. Over the course of a few months, I can generate a dozen or so branches, most of which are stale. I run this bash script in my Git repo to list all of the remote branches I have last touched and delete the ones that are no longer needed.
for branch in $(git for-each-ref --format='%(refname:short)' refs/remotes/); do
email=$(git log -1 --pretty=format:'%ae' "$branch")
if [ "$email" = "$(git config user.email)" ]; then
echo "$branch"
fi
done
And this does the same except for local branches:
for branch in $(git for-each-ref --format='%(refname:short)' refs/heads/); do
email=$(git log -1 --pretty=format:'%ae' "$branch")
if [ "$email" = "$(git config user.email)" ]; then
echo "$branch"
fi
done
helix#
Modal text editor.
How to align selections#
- Select items and then hit
&
.
tr#
Converting text to lowercase#
echo "YOUR STRING" | tr '[:upper:]' '[:lower:]'
zellij#
Terminal multiplexer.
Horizontal split on a pane#
Some times when I create a new pane using <Alt-n>
, it uses a vertical split rather than a horizontal split.
To do a horizontal split do: <Ctrl-g>, p, <Alt-g>, d
.
Note: This works as of this configuration.