What are your favorite CLI tools/applications?
While I've been teaching myself my first programming language (Python), I've been getting more into using the terminal as much as possible to build familiarity and get comfortable. This has opened my eyes to so many useful utilities and makes me curious as to what there is out there that I haven't heard of yet.
My favorites so far:
exa - A modern version of "ls"
youtube-dl - Download videos from youtube.com or other video platforms with various options
hledger - Plain text double-entry accounting software based on ledger written in Haskell
thefuck - App that corrects a spelling mistake in the previous command by typing "fuck"
spicetify-cli - Customizes the Spotify client with themes and extensions
spotifyd - Lightweight Spotify daemon
spotify-tui - Control Spotify in the terminal
neofetch - Launch tool that can display ASCII art or pictures and general system information
I'm on macOS but I'm almost certain all of these are cross-platform.
What are your favorite or "must-have" CLI packages?
+1 on micro - if only because it so nicely/simply supports good ol' ctrl-c for copying and ctrl-v for pasting. ;-)
Vim is well worth the time investment if you want a good editor for your programming (or for any plaintext editing, really).
bat is a nice replacement for
cat
andless
that adds syntax highlighting for recognized file formats. I have a couple aliases that let me neatly replace both of those commands with it:I also wrote a couple functions to use it to mimic
head
andtail
:I haven't done robust testing on those but for my limited uses of
head
andtail
they work. It's nice to have pretty colors in these old-school CLI utils.Note: I hard-coded the paths to actual
head
andtail
binaries on my system, which may be different on your machine.Here's a rambly list of utilities that you might find useful. I've included TUIs and such since you seem to have included them in your post:
ffmpeg
is the swiss army knife of audio and video. Need to convert formats? Change a file's volume? Screen record/screenshot? Slow down a video? Reduce a video's size? Cut a snippet? Crop black bars? It can do it all and much, much more.But for actually playing them (although FFmpeg does come with
ffplay
, which can play files), I usempv
. I don't think it's ever failed to play a video (although playing videos may not be considered CLI) for me, when every other player has multiple times, and it supports stuff like YouTube links (usingyoutube-dl
as its backend, which I also find great) and playing from a virtual terminal with thedrm
driver.ripgrep
is a very fastgrep
alternative; great for searching directories and such. In a similar vein,fd
is an alternative tofind
, although I find the former more useful.rsync
is my go-to for copying files beyond simplecp
uses. It can show a progress indicator, sync files (only copying the differences), copy to remote locations, etc.hyperfine
has a lot of features for benchmarking.netcat
is the swiss army knife of networking; I don't really do complex networking stuff, but it's still useful for things like checking for open ports, opening connections (I usually use this for sending extremely long URL from a device to another), etc.It's a bit obvious, but Bash itself is one of the most useful tools to me outside of
coreutils
, and it's often underutilized. Python is also great for stuff like creating an HTTP server that serves a directory's contents.wget
is great for robust or complex downloading. My internet connection is often spotty andwget
is a godsend, retrying downloads and allowing you to continue stuff. It's almost (though not quite) like torrenting! Also, you can download everything in a link, which I use with Python's HTTP server that I mentioned earlier to transfer directories when I don't want totar
things up or set up SSH.curl
is also great stuff like checking redirects.Speaking of torrenting, I use
rtorrent
for that. I've also been meaning to look intoaria2
.tmux
is great, not just for splitting a screen, but stuff like sharing a session across terminals and keeping a session alive after an SSH (OpenSSH
is also part of this list!) session is killed.bc
is great for calculations beyond the extremely simple stuff that Bash can handle.Vim is my go-to for text editing and it's everywhere.
weechat
is my preferred IRC client.I'm a recent convert to ripgrep. Admittedly my needs tend to be very simple (I'm not some sort of grep ninja), so grep is fine too...but ripgrep sure is fast!
I adore
ffmpeg
for quick and easy conversion of audio files.I've only just started with
alpine
but am liking it pretty well as a mail reader.bc
works well as a simple calculator but is apparently stupid powerful, with applications well beyond my ken.cmus
is my preferred music player.rsync
is great for backups or pushing changes to remote servers via ssh.wordgrinder
is a simple little word processor that can export to various file formats.pandoc
is good for changing programs between file formats.tty-clock
is good if you like tiling window managers and don't like status bars.tuir
is good if you're still nursing a reddit addiction.EDIT:
youtube-dl
is incredible too!If you are using zsh (the new default shell on macOS) you should check out Oh My ZSH. They've got lots of CLI programs in the form of plugins. I use the
git
,wd
(warp),osx
,spotify
, andvsca
(VS Code) plugins all day every day.I’m really late, but prezto is another alternative. Personally, it worked better for me than Oh My ZSH. OMZ, for some reason, would take a second or more to print the prompt after every command, even without any plugins active.
git
, use it for pretty much every project. Also for dotfiles.rsync
: for backups / syncing.vim
: Slowly learning it, but it has currently replaced other text editors in the terminal for me.rtv: reddit terminal client. My usual goto, since the website is crap.
rtv
isn't maintained anymore but there are some forks. Should update sometime.tealdeer,
tld
: Get TL:DR's for CLI tools, quite useful when you forget the arguments for commands liketar
again.bat:
cat
with colors. Aliased tocat
.exa:
ls
with colors. Aliased tols
.ripgrep,
rg
:grep
replacement.I should really learn some Rust, using so much of it :P
I knew of youtube-dl for quite some time now...but for some reason i find myself using it tons more recently. I used it at first to mostly download DJ mixes and burn them to CDs (for listening in my old car)...now when i download the mixes, i just instinctively listen to them offline. If you have a playlist of media from youtube that you want to view/listen to without ads, youtube-dl is the way to do it. (Not that the ads bother me much, but i guess it might be important for others.)
Other than already listed
(n)vim
andthefuck
, I really like tldr a much friendlier and simplified tool alternative toman
I like tldr, but recently learned of http://cheat.sh/ - and yes it is curl-able from the terminal. For example, in order to learn about the "ls" command, you would run the following:
curl cheat.sh/ls
As long as you have curl installed, you don't need to install "cheat.sh" nor anything else - pretty nifty! (This assumes you have internet connectivity of course.) I have it set as an alias on my linux laptop, so just do something like:
cheat ls
(and then it runs "curl cheat.sh/ls")
That's neat in a pinch but I also appreciate the tab completion of having the utility installed on my computer.
Yeah, that is a good benefit.
For me, excluding the standard *nix tools, it is fzf.
At its base, it's a simple filter: you can pipe lines to it and interactively and fuzzily select out of them. But it also provides a lot of integrations out of the box like shell commands (history search, selecting files, entering directories and so on) and editor integrations. And then there are of course a lot of third-party integrations, of which my favorite is probably notational-fzf-vim for note taking and searching.
It's just so simple tool, that advances the whole ecosystem by providing a simple way to greatly improve upon the standard CLI user experience.
z or autojump are invaluable for navigating to frequently used directories quickly.
tmux for dealing with more than one shell at a time. I use alacritty on OS X, which doesn't have tabs and splits, and tmux is nicer anyways. I spend my entire day in vim inside tmux.
multitail lets you essentially do a
tail -f
on multiple files at once which is very useful for checking out multiple log files when debugging.In a similar vein, mssh lets you log into multiple hosts to allow you to issue commands to them all in bulk. Very handy for one-off maintenance or hotfixes.
jq as it describes itself is '
sed
for JSON'.bpython is great if you are pythonista
I use
kickstart
to manage my project bootstrapping, which I find to be really useful.Along with what other people have been saying, I use potato and alarm as simple pomodoro and alarm apps respectively.
As for Python programming, I've been playing around with flake8 (with an extension for pydocstyle) and Mypy recently.
In addition to the common ones others have said:
curl -s "$@" | jq -C '.' | less
I learned about exiftool only a few months ago myself, and have used it a few times to great benefit! The first time that i needed to use it, i had one of those moments where i literally said to myself: "where have you been all of my life!?!" :-)
Very good timing. I'm an American working remotely from the Philippines. Unfortunately due to the sudden pandemic lockdown, I am in a waiting queue to get fiber internet installed (weeks already). I have no choice to use my phone's hot spot, which is slow with frequent outages. I've since become productive working through ssh to a remote Digital Ocean box. I use about 400mb of data per day.
Essential tools for low bandwidth and recommended terminal utils:
dtach
to keep the client running in case I accidentally close the terminal. The only con is agent forwarding doesn't work well. I opted to generate secondary keys on the server itself.BTW, latest Windows Terminal works great with tmux and mouse. I rarely use the mouse, but it comes in handy to select text in terminal and tmux. I run mosh from Ubuntu (WSL). Developing from Windows is great again.
My workflow is:
Some cool things here in your list. In particular: usql and ncdu. I'll check those out. But re: silver searcher: Does ripgrep have good features over and above what
ag
provides? Or is it strictly the improved speed that you like? I ask because speed is not really a concern for me as far as grepping tools go.My development workflow is git + tmux + vim + ctags + ranger. The only thing really lacking is namespace and object property autocomplete (ie type “std::cout.f”, hit ctrl-n, and select “flush” from the list).