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.
socat
- connect anything to anythingfor example
socat - tcp-connect:remote-server:12345
socat tcp-listen:12345 -
socat tcp-listen:12345 tcp-connect:remote-server:12345
Control+r == search through your bash history.
I used linux for ten years before finding out about that one.
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
jq - super powerful json parser. Useful by hand and in scripts
I love jq, but I wouldn’t call it “surprising simple” for anything but pretty-formatting json. It has a fairly steep learning curve for doing anything with all but the simplest operations on the simplest data structures.
It’s not even pretty or accessible. 2-spaced indentation is incredibly hard to read.
It can also format minimized JSON from cURL API requests
Combine with jc to process CSV files. This is how I get data into my plain text accounting system.
jq
andyq
are both things I install on pretty much every machine I have.
bc
It’s a simple command line calculator! I use it all the time.
Pandoc.
yes
The most positive command you’ll ever use.
Run it normally and it just spams ‘y’ from the keyboard. But when one of the commands above is piped to it, then it will respond with ‘y’. Not every command has a true -y to automate acceptance of prompts and that’s what this is for.
Man
zoxide. It’s a fabulous
cd
replacement. It builds a database as you navigate your filesystem. Once you’ve navigated to a directory, instead of having to typecd /super/long/directory/path
, you can typezoxide path
and it’ll take you right to/super/long/directory/path
.I have it aliased to
zd
. I love it and install it on every systemYou can do things like using a partial directory name and it’ll jump you to the closest match in the database. So
zoxide pa
would take you to/super/long/directory/path
.And you can do partial paths. Say you’ve got two directories named
data
in your filesystem.One at
/super/long/directory/path1/data
And the other at
/super/long/directory/path2/data
You can do
zoxide path2 data
and you’ll go to/super/long/directory/path2/data
You can do
zoxide path2 data
I usually would just do
z 2data
. Yes, I’m lazy. It’s the perfect tool for lazy people.Nice! I guess I can be even lazier when navigating!
Sounds a lot like autojump
I’m not familiar with
autojump
Better than fasd?
netstat -tunl
shows all open ports on the machine to help diagnose any firewall issues.probably well known at this point but rsync is incredible and I use it all the time
xargs
I don’t see anyone mentions
htop
. So, I will:) Just works, could be installed in any distro. Much more friendly than top but isn’t bloated with features as some other alternatives are.Check out BTOP++ – it blows htop out of the water.
My fav for the past few years is https://github.com/ClementTsang/bottom
Bashtop if you want something more graphical
batcat
It’s like cat but better. Great for when you just want to look at the contents of a file, without loading a whole text editor.
Oh also, tldr
My procedure for learning how to use a cli command goes tldr page -> --help if the tldr fails to help me -> THEN the full manpage
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
Why would you want password less backups?
I understand if the reason is ‘just because’, but seriously, why? I just write down the password in a text file for restic --password and I am done.
write down the password where though, somewhere I can guarantee it will always be there 10 years from now? That’s a big ask of me
That is true for lots of things.
Moreover I use one easy “default” password for all basic stuff, and its always the same known to my spouse and written down on paper.
At least my offsite backups are protected from prying eyes. Maybe uneeded for local backups, but doesn’t hurt to have.
I keep mine in Bitwarden, I export that data every 3 months and store it in a Backblaze backup, I have it written on a piece of paper stored in a locked fire box in my house, and that paper scanned in my phone.
I can’t imagine not having at least one of those in 10 years and I can’t imagine all four failing in the same week.
Does that give you any helpful ideas that would work for you?
None that I can see persisting, as I move around a lot and my backups tend to get boxed up for periods of time before being unboxed. But, I appreciate the effort
I’ve gotta agree here that passwords - (and encryption) - should be optional.
10 years? Boy you are joung :)
I have encrypted files from w 20 years ago, and unencrypted files from 30 years ago.
And digitized stuff from analogic of 40 and 50 years ago.
-