Which Linux command or utility is simple, powerful, and surprisingly unknown to many people or used less often?
This could be a command or a piece of software or an application.
For example I’m surprised to find that many people are unaware of Caddy, a very simple web server that can make setting up a reverse proxy incredibly easy.
Another example is fzf. Many people overlook this, a fast command-line fuzzy finder. It’s versatile for searching files, directories, or even shell history with minimal effort.
- xargs
- parallel
- PXE (ohai cobbler)
- tee
- task-spooler (ts aka tsp)
- rpm -V
Nothing new, just forgotten.
task-spooler (ts aka tsp)
This looks amazing. Do you know how well it works in dispatching and tracking jobs over remote servers (over SSH)?
We’ve been using tsp at my work for years and it works well. It is just a very basic queueing system so if you can run the job from the command line then you can run it via tsp.
Our workflow is to have concurrent jobs run on the remote servers with cron and tsp but you should be able to trigger remote jobs over SSH also if you prefer to have a single machine in charge of task allocation.
deleted by creator
I’d like to interject for a moment. There is also a tool called bat that is just cat with extra features. It prints out and works just like cat, but when the contents get too big, it works like less. The is syntax highlighting and works with git.
It’s replaced my need for cat and less.
Yes! I use less all the time, combine it with grep, etc.
Try bat…
cat <your file> | more
Useless use of cat award!
I’m a big fan of
screen
because it will let me run long-running processes without having to stay connected via SSH, and will log all the output.I do a lot of work on customers’ servers and having a full record of everything that happened is incredibly valuable for CYA purposes.
I’d recommend
tmux
for that particular use. Screen has a lot of extras that are interesting but don’t really follow the GNU mentality of “do one thing and do it well.”Tmux / Screen is like the emacs/vim of the modern day Linux I think.
Screen is more than capable, but for those who have moved to Tmux, they will absolutely advocate for it.
When tmux was first released I was already so used to screen that I never really considered switching. What would some convincing arguments be for me to make the effort to switch now?
Tmux was purpose built for terminal multiplexing. You can assign session names for organizing and manipulating multiple instances. Send keys to and read output from detached sessions. It’s easy to script.
Tmux was purpose built for terminal multiplexing.
Was screen not purpose built for terminal multiplexing?
Sorry, it was, just not for exploring all of those instances at once. Should have called out the tiling function. Screen also built in a serial terminal emulator and started playing with a few other things.
This was a few years ago so maybe it has improved, but I found that screen would crash and lose my session history and layout too often. That was bad enough, but when it happened it had some bullshit error message about a dungeon roof falling in. I don’t mind some comedy in code or even the interface, but don’t make light of the user losing their stuff. I tried tmux and it is much more stable than screen was.
The thing that got me to switch was being able to maintain my pane layout between connections. The various window and pane management niceties (naming, swapping, listing and the like) got me to stay. Now you can keep your screen, but you’d have to pry tmux from my cold, dead, tty.
I know everyone likes tmux but screen is phenomenal. I have a .screenrc I deploy everywhere with a statusbar at the bottom, a set number of pre-defined tabs, and logging to a directory (which is cleaned up after 30 days) so I can go back and figure out what I did. Great tool.
nohup
is similarIt’s not as useful, sadly. Nohup disconnects standard input, output, and error. With screen or tmux, you can reattach them later.
Woah screen is seeing active development again? There was like a decade where it stagnated. So much so that different distros were packaging different custom feature patches (IIRC only Ubuntu had a vertical split patch by default?) Looking at it now, the new screen maintainers had to skip a version to not conflict with forks that had become popular.
When tmux stabilized I jumped ship immediately and never looked back.
tmux with control mode in iterm is god mode for me on all my machines. Absolutely love it.
Using rust rewrite of coreutils you can
cp -g
to see progress. Set an alias :)Holy shit I was just talking about cp with progress today. Awesome
Where can this variant of coreutils be found? This is the first time I have heard of it.
mlocate
Do you have to wear the fedora to run this command?
No sorry, I should have elaborated. The package name is
mlocate
but the command islocate
. Occasionally runupdatedb
as it populates an sqlite db with every file on your system that you can then list out usinglocate
followed by the filename you want to locate.EDIT: Lol. Sorry barely read your reply. Yes, you should wear a fedora while installing
mlocate
.
I immediately had flashbacks of diagnosing bad I/O performance on CentOS 5 servers. That was the week when I learned what updatedb is and why it was always running in the background (there was a lot of files)
I love locate! I have a cronjob that updates the db every night, then I can just find a file without having to think about where it is
yq can do both JSON and YAML :)
Funny how this was one of the first tools I learnt once I “seriously” started my linux journey, lol
https://github.com/johnkerl/miller is like awk, sed, cut, join, and sort for name-indexed data such as CSV, TSV, and tabular JSON
I like https://github.com/aristocratos/btop personally. It’s way prettier than the normal top command which you use to watch processes to find the one that’s hogging all of the CPU or whatever. And it’s not so much that it’s underrated so much as it’s not very well known or distributed by default.
Gripes:
-
starship and all these shell frameworks are overbloated. Just write your own prompt command and be done with it.
-
restic, ongoing issue with the author to allow people to backup without a password. Seems lime a no-brainer but he’s being difficult
-
grep goes crazy if you know your regex
I can never get grep to work consistently on Mac and Linux. Now, ripgrep OTOH…
That’s because Macs generally use BSD-based command line tools instead of GNU ones. You have to do a lot of Homebrew jiggery-pokery to approximate a GNU environment. Know Your Tools: Linux (GNU) vs. Mac (BSD) Command Line Utilities
Alas, doesn’t fit my purpose since it requires action by the script user. I usually just use perl in those situations
Check out my chapter on GNU grep BRE/ERE for those wanting to learn this regex flavor: https://learnbyexample.github.io/learn_gnugrep_ripgrep/breere-regular-expressions.html (there’s also another chapter for PCRE)
Discovered about rg recently and it is cool!
deleted by creator
FFMpeg Simple and underrated? Not sure about that.
Not in and of itself, but I find that I have a handful of common tricks that I can put into aliases. Also, there’s ffmpeg.app!
deleted by creator
similar to ImageMagick,
jpegtran
is great for lossless jpeg transformations. You can even extend jpegs using the “crop” function, which can be very useful for batch-processing images, even though it’s hardcoded to middle grey.
yq is crazy cool for converting between different text-based data formats such as yaml, json, xml, csv and others, and it has a super nice pretty-printing function as well. I use it all the time!
Just be aware that your distroy might come with a yq variant too, but possibly one that isn’t as powerful as the one I linked. I know this to be true at least for Ubuntu.
See also https://github.com/TomWright/dasel
I used jq for something similar before, recently I’ve discovered Nu Shell and have been using that for converting and analyzing data since a full shell is a lot more powerful than a command (e.g. open a yaml, for each element on key X grab the first element of list Y and export to a CSV)
dd
is probably well known, but one of the simplest and most powerful ways to accidentally delete all data on your hard drive.dd if=/dev/random of=/dev/sda
ddrescue (or gddrescue) is a great version if you have a sick drive. It’ll try to copy the good areas first then go back to hammer on the sick areas.
Not perfect as it doesn’t know about the file system so it tries to copy the entire surface, but generally a good tool.
Underrated? I’d say lftp is the best FTP command line client there is. And Midnight Commander is a very very good file browser. I don’t see either praised enough.
Lftp is fast. Those parallel chunked downloads are not a joke
The terminal-based file browser space is so filled today but for my part I love what vifm has done for the dual-pane midnight commander concept - it’s the same basic idea, uses (somewhat) vim-like bindings by default and is super extensible.
Great call out! I first used ftp about 30 years ago, and lftp has been my go to for about the last decade. I rarely need it anymore, but I still use it for quickly transferring files with my homebrew switch.
Did you know it can connect to HTTP directory listings and do the same things it does over S/FTP?
I did not! Interesting feature.
Not powerful, but often useful,
column -t
aligns columns in all lines. EG$ echo {a,bb,ccc}{5,10,9999,888} | xargs -n3 a5 a10 a9999 a888 bb5 bb10 bb9999 bb888 ccc5 ccc10 ccc9999 ccc888 $ echo {a,bb,ccc}{5,10,9999,888} | xargs -n3 | column -t a5 a10 a9999 a888 bb5 bb10 bb9999 bb888 ccc5 ccc10 ccc9999 ccc888