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.

41 points

jq?

permalink
report
reply
2 points

Funny how this was one of the first tools I learnt once I “seriously” started my linux journey, lol

permalink
report
parent
reply
4 points

https://github.com/johnkerl/miller is like awk, sed, cut, join, and sort for name-indexed data such as CSV, TSV, and tabular JSON

permalink
report
parent
reply
13 points

I use it occasionally but every time I need to do something a tiny bit more complex than “extract field from an object” I have to spend half an hour studying its manual, at which point it’s faster to just write a Python script doing exactly what I need it to do.

permalink
report
parent
reply
4 points

Check out https://www.nushell.sh/ I use it for exactly that, i.e. complex extract and convert files

permalink
report
parent
reply
1 point

I actually installed it recently out of curiosity, but I’m hesitant about learning its advanced features like that. At least jq is a standalone tool that’s more ubiquitous than nushell, so you can rely on it even in environments that you don’t fully control (e.g. CI like GitHub Actions). And if you use it in some public code/scripts then other people will be more familiar with it too.

permalink
report
parent
reply
11 points

yq can do both JSON and YAML :)

permalink
report
parent
reply
5 points
*

+1 to caddy. There are some services that set safe headers following the recommendations outlined by Mozilla but others don’t control headers as strictly. Caddy is the only web server that I found that supports loose default header values. These values will be selected unless the upstream application specifies their own values.

You can do something similar in nginx but it requires playing with maps and has a little more indirection than I’d like.

Just wish caddy was capable of starting as root and stepping down permissions like Nginx. I have certs being managed by other tools and have to make sure they are installed and chowned for caddy’s use when they are cycled.

permalink
report
reply
3 points

I just started the process of switching from nginx Proxy Manager to Caddy yesterday, and even before setting up a single rule, I’m enjoying it more than NPM. Really wish I would have heard about it sooner!

permalink
report
parent
reply
1 point

I’m currently using NPM and don’t have any problems with it for at least my use case. Is there something I’m missing out on never having tried Caddy, or is it one of those no need to switch if there’s Nothing bugging you situations? That last bit is how I feel about Bazzite on the Steam Deck when people ask of they should switch.

permalink
report
parent
reply
35 points

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.

permalink
report
reply
14 points

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.”

permalink
report
parent
reply
7 points

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.

permalink
report
parent
reply
2 points

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?

permalink
report
parent
reply
2 points

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.

permalink
report
parent
reply
4 points

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.

permalink
report
parent
reply
6 points

nohup is similar

permalink
report
parent
reply
3 points

I’ve had nohup fail to keep things running after my session ended quite frequently. It’s like it just goes to the next step in the process then gives up.

permalink
report
parent
reply
2 points

It’s likely that you’re using a systemd based system and the admin hasn’t enabled linger for your user.

permalink
report
parent
reply
1 point

It’s not as useful, sadly. Nohup disconnects standard input, output, and error. With screen or tmux, you can reattach them later.

permalink
report
parent
reply
12 points

There is also zellij, which can do the same but also has modern functionality specific for development workspaces!

(Although screen or tmux will still probably be more widely available on remote machines etc)

permalink
report
parent
reply
6 points

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.

permalink
report
parent
reply
4 points

tmux with control mode in iterm is god mode for me on all my machines. Absolutely love it.

permalink
report
parent
reply
5 points

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.

permalink
report
parent
reply
84 points

A few that I use every day:

permalink
report
reply
21 points

I heard about helix from you and I’ve used it for a year and a half or so now, it’s by far the best editor I’ve used so far and I can definitely vouch for it

permalink
report
parent
reply
6 points

Nice!

permalink
report
parent
reply
1 point

Could you explain them in more depth? I opened them and don’t know

permalink
report
parent
reply
3 points

Fish is a replacement of bash that’s a bit more user friendly (has some cool auto completion features out of the box and more sane behaviour like handling of spaces when expanding variables). I personally started to use nutshell recently but unlike fish it’s very different from bash.

Starship is a “prompt” for various shells (that bit of text in terminal before you enter the command that shows current user and directory in bash). I haven’t used it but AFAIK it has many features like showing current time, integration with git, etc.

permalink
report
parent
reply
6 points

Yep, here’s my Starship prompt, for example:

So, I have it configured to show:

  • the exit code of the last command (if it’s non-zero),
  • the duration of the last command (if it’s longer than 2 seconds),
  • the time (when the last command ended),
  • the current directory,
  • the current Git branch, and it also shows some Git status information, for example the $ means I have something stashed,
  • and finally the technology in use in a repository/directory, so in this case that repo uses Rust and the compiler version is 1.83.
permalink
report
parent
reply
1 point

Thanks!

permalink
report
parent
reply
7 points

Helix is a terminal based text editor. It’s much like vim / neovim, but unlike those editors it’s good to go right out of the box, no configuration or plugins needed to make it work well.

Topgrade is one I haven’t used, but it looks like its intended purpose is to let you upgrade your apps with one command, even if you use multiple different package managers (I.e. if you were on Ubuntu, you could use it to upgrade your apt packages, at the same time as your snap packages, as well as flatpak, nix, and homebrew if you’ve added those.)

permalink
report
parent
reply
2 points

Thank you for explaining. I would never have understood topgrade without your example :)

permalink
report
parent
reply
15 points

Just commenting to give more love to helix. It’s my favorite “small quick edits” editor.

permalink
report
parent
reply
5 points

I’ve actually been testing with fish recently coming from zsh, though I might wait until 4.0 fully releases before I make a more conclusive decision to move or not.

With that said, I remember looking through omf themes and stumbled onto Starship that branched off one of the themes and really liked the concept.

permalink
report
parent
reply
6 points

One thing that holds people back sometimes is that bash scripts that set environment variables don’t work by default. https://github.com/edc/bass is an easy solution

permalink
report
parent
reply
2 points

Helix is great thanks

permalink
report
parent
reply
2 points

Once Helix gets plugin support and someone makes a Clojure REPL plugin as good as Conjure I am never touching vim again!

permalink
report
parent
reply
0 points

It does have clojure lsp support, but you’ll probably have to use a command line for most repls.

permalink
report
parent
reply
2 points

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.

permalink
report
parent
reply
1 point
*

Do you have experience with either ranger, lf, or yazi? I’m wondering how broot compares. Big fan of file ranger, and this looks very similar.

permalink
report
parent
reply
1 point

I’ve used ranger, but I’m not as big a fan of it as broot.

permalink
report
parent
reply
5 points

People always sleep on script. It’s badass and let’s you do goofy things like this while keeping standard terminal formatting: https://github.com/StaticRocket/dotfiles/blob/043e9a56cc9515060188ec4642e4048c0dd6c000/dot_bashrc#L79-L94

permalink
report
reply
1 point

From your example, I have a hard time inferring what is it doing.

permalink
report
parent
reply
1 point

Executing a command, capturing all terminal formatting and escape codes so I can do some light manipulation on leading whitespace before dumping it back to the terminal.

permalink
report
parent
reply

Linux

!linux@lemmy.ml

Create post

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

Community stats

  • 6.8K

    Monthly active users

  • 6.9K

    Posts

  • 186K

    Comments