Abstract
Recently I have been working on DPorts in DragonFlyBSD; during that process I have really come to appreciate many of the command-line tools available to me during that process. In that spirit, I thought I might do a write up on some command-line tools that people newer to Linux/Unix systems may or may not be aware of, as well as sharing some tools that make life easier that even experienced Linux/Unix users may or may not be aware of.
Base System Tools
The following are command-line tools that are available in most base systems on Linux, BSD, and Unix systems. Learning these tools in one place will almost certainly tansfer (though not 100% due to flag differences) between systems.
Package manager for OS: Most modern Unix-like operating systems have a command-line package manager. They might be more difficult to use than the graphical package manager, they aren’t usually too difficult and often are much more powerful.
vi
/nvi
: The classic editor that is always there. Yes, it is a bit difficult to get used too, but once you do it will never let you down. Whennano
isn’t availablevi
ornvi
will be as it is an integeral part of many base systems.which
:which
is a simple tool, however, it makes it very easy to find where executable files (either binaries or scripts) are located within the user’s$PATH
.find
: Thefind
command is another classic command that will assist in finding files on your computer. it can search with or without case sensitivity and even allows for some REGEX.grep
:df
anddu
: While these tools are separate, they go together very nicely.df
will show the disk usage on the various drives on the system,du
will show how much disk space individual files or entire directories are taking up on the system. It is worth noting thatdf
may be inaccurate with file systems like ZFS because of the way that ZFS handles free space. If ZFS anddf
disagree with the amount of space available on the system, ZFS is the one that should be trusted as it knows much more about disk usage and what the file system is doing.scp
: Secure File Copy, orscp
is the command that allows users to send one or multiple files from one machine to another viassh
.make
: The `make’ tool is very commonly used for programming and compiling code. It is not something that everyone will use, however, it can do quite a bit more than just compiling code. The relevant excerpt from the GNU make man page:In fact, make is not limited to programs. You can use it to describe any task where some files must be updated automatically from others whenever the others change.
Third Party Tools
The follow tools are ones that are worth mentioning as they are generally useful, and some are tools that newer user may not be aware of.
htop
(plenty of alteratives as well)- Good editor: In the world of modern Unix and Unix-like operating
systems, this is very similar to telling most people how to apply
thermal paste for CPU coolers. The two main camps are vim and/or neovim versus emacs, and while I could
make an argument for either, it really doesn’t matter. Both are
extremely powerful and far more capable editors than things like notepad++; I recently got one
of my co-workers using
vim
and it has improved his workflow immensely. He said things that used to take him hours now takes him minutes. I emaacs is equally powerful, and can even emulate vim keybindings with evil mode (what I generally prefer using on Spacemacs). lf
: A terminal file manager written in go. Truthfully, I find most TUI file mangers faster and more efficient than usingcd
/ls
to get around in directories, butlf
is my favorite that I have used up to this point. It is fast, feature rich, and very customizable. The two alternatives that I have found that are also good arennn
andranger
.rsync
: This tool is very similar toscp
, however, rather than transferring the whole file the same way thatscp
does, it has a delta-transfer algorithm that reduces the amount of data sent on the wire. It can do this to move files around on one machine, or it can send files to a remote daemon (yes,rsync
must be installed on both ends for it to work between machines).pandoc
:pandoc
is a tool that is written to convert from one markup format to another. I find it particularly useful for converting markup into a PDF or HTML. However, it has support for other formats like: docx, rtf, and txt. It makes taking good quality notes very easy.- LaTeX: LaTeX is a huge typesetting program originally that is often used in academia for its formatting capabilities. It is difficult to summarize its capabilities while also doing the program’s power justice. If interested, here is a source that I often reference when I write a LaTeX document.
git
: There are few people that have not at least heard of Git. However, some people may not think that it worth taking the time to learn as they are not developers. While Git is most widely known for software version control, it works very well with any plain text file, including config files, making it easy to back up and version control config files for various parts of a system.yt-dlp
: This is a feature rich command-line audio/video downloader that works on thousands of sites. It is a fork ofyoutube-dl
based around the interactiveyoutube-dlc
.iperf3