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
A few that I use every day:
- Fish shell
- Starship.rs
- Broot (a brilliant filesystem navigator)
- Helix editor (My favorite editor / IDE, truly the successor to vim IMO)
- Topgrade (updates everything)
Just commenting to give more love to helix. It's my favorite "small quick edits" editor.
Once Helix gets plugin support and someone makes a Clojure REPL plugin as good as Conjure I am never touching
vim
again!It does have clojure lsp support, but you'll probably have to use a command line for most repls.
Yeah the clojure lsp support is top notch, but there being no support for "jacking in" to a repl is the big thing keeping me from using helix full time. There's a way of doing it if you use kitty, but it's pretty janky.
Could you explain them in more depth? I opened them and don’t know
this just reminds me of
please
which runs the previous command withsudo
That sounds dangerous. I hope it never tries to fix anything with
rm
Very useful for shell scripts that need to do maths as well. I use it to make percentages when stdout has values between 0.0 and 1.0
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
netstat -tunl
shows all open ports on the machine to help diagnose any firewall issues.netstat is kind of deprecated,
ss
is more modern (from the iproute2 package) and uses very similar parameters.
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.
That's really neat but also seems like it could be quite dangerous in a lot of use-cases!
nano was and still is vital to me learning and using linux, I will not learn how to use vim so if the distro forces it to be default im not using it.
Why is editing text so convoluted for seemingly no reason.. also hate that vim must be used for certain files.
Wow you triggered a lot of vim users !
Maybe give micro a shot :) It's nano but more sane defaults and comes with customization in mind.
vim isn't required for any files, you just followed online tutorials for how to edit those files instead of RTFM
terminal text editing is convoluted because it has to strike a balance between figuring out when a keypress is part of the text you're typing, vs when it's a command you're using, and making sure that all the editor commands the designer wanted are accessible.
vim is great because it allows for thousands more editing commands and macros, and much more customization of the editor, up to allowing plugins that emulate other functionality. As it stands, my setup basically functions as a full, lightweight-ish, multi-language IDE that rivals Emacs or Visual Studio.
On top of all that, I don't have to move my hands away from the homerow of keys to navigate or edit, which may not seem like much, but adds up to a lot of avoid typos and time saved from moving my hands to reach the arrows/delete/home/end/pgup/pgdn.
Some examples:
h
,j
,k
,l
move left, down, up, and right respectively, but they can be combined with a number to move that many rows or columns; e.g.6j
will move down 6 rowsdd
deletes a line, but using a number +d
+ a movement will delete that many characters/lines in the path of the cursor: e.g.34dl
will delete 34 characters to the right of the cursor,12dk
will delete 12 lines up.gg
will take you to the first line,G
will take you to the last, and number + either will take you to that line: e.g.3275gg
or3275G
will take you to line 3275and finally you can use
/text or regex pattern you want to search for
and Enter to search the document for the first occurence below your current location, and then usen
to search for the next occurence, orN
to search for the previousThat doesn't even scratch the surface (that's just the cheatsheet, which only scratches the surface), but if you can get a handle on only what I've said, and switching between input and command mode (
i
andEsc
respectively), the speedup to navigation alone will make it seem more sensible.And as always, don't forget to
:wq
(write to file and quit)seems like you need to try micro. It's like nano, but with more sensible standard keybinds imho, as well as syntax highlighting and global clipboard use.
nmap *your_local_ip_address*
for example
nmap 192.168.1.43/24
will show you what devices are connected to the local network, and what ports are open there. really useful, for example, when you forgot the address of your printer or raspi yet again.you can also use it to understand what ports on your computer are open from an attacker's perspective, or simply to figure out what services are running (ssh service).
losetup
it's useful for dealing with virtual disk images. like a real physical hard disk, but it's a file on the computer. you can mount it, format it, and write it to a real physical disk.
it's sometimes used with virtual machines, with iso images, or when preparing a bootable disk.
I find myself using tldr a lot since finding out about it. It's just so useful for commands that I don't use enough to commit to memory.
You type tldr and then some command. For example, tldr tar. It gives you a small list of examples and common use cases for the command.