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.

  • @stembolts@programming.dev
    link
    fedilink
    109 days ago

    awk

    …for parsing the output of other commands quickly and simply. Then that parsed output can be used to create simple log messages or be passed as args to other scripts. Powerful.

      • @stembolts@programming.dev
        link
        fedilink
        9
        edit-2
        9 days ago

        I agree with your sentiment regarding confusing syntax, however I think that confusion simply requires a calculated approach to dispell it.

        It’s a prime example of why I use scripts as reminders as much as I use them functionally. I work out the syntax once… save it to an example script, then save myself 20 minutes of remembering by just $ cat ./path/to/script.sh and copying said syntax.

        So if you can change your workflow such that learned things stay around as examples, I feel that you will pick it up much more quickly :)

  • @harsh3466@lemmy.ml
    link
    fedilink
    308 days ago

    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 type cd /super/long/directory/path, you can type zoxide 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 system

    You 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

    • @tetris11@lemmy.ml
      link
      fedilink
      28 days ago

      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)?

      • Sʏʟᴇɴᴄᴇ
        link
        fedilink
        48 days ago

        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.

  • socat - connect anything to anything

    for example

    socat - tcp-connect:remote-server:12345

    socat tcp-listen:12345 -

    socat tcp-listen:12345 tcp-connect:remote-server:12345

  • jollyroberts
    link
    fedilink
    English
    358 days ago

    Control+r == search through your bash history.

    I used linux for ten years before finding out about that one.

  • TurboWafflz
    link
    fedilink
    169 days ago

    I’m not sure how underrated it is but the exec feature in find is so useful, there are so many bulk tasks that would just be incredibly difficult otherwise but instead are just one line

    • Daniel Quinn
      link
      fedilink
      English
      29 days ago

      Just be careful with files with spaces in the name. There’s an incantation with xargs that I always have to look up when I want to use it safely.

  • @kyub@discuss.tchncs.de
    link
    fedilink
    English
    129 days ago
    • awk
    • the (usually rust-based) coreutils “alternatives” like bat, fd, eza, procs
    • trash-put (rm with trash integration. But beware that it also operates on directories by default, which rm only does with -r. There should be an option to change that behavior but there isn’t. Don’t alias rm to this)
    • wl-copy/paste (or the older one for X11, ‘xclip’ IIRC. Enables you to do stuff like “cat image.jpg | wl-copy” to copy it to the clipboard. Best alias it to something shorter)
    • xdg-open (open the file using your associated program for that file type. Alias to “o” or so)
    • pass (awesome password manager, when you have a GPG key pair. Even better in combination with e.g. wofi)
    • notify-send (to send GUI notifications from shell scripts)
    • ledger (plain-text accounting software. If you use Emacs you should take a look at this as it’s written by an Emacs dev, and has good integration of course)
    • nc
    • nohup
  • @friend_of_satan@lemmy.world
    link
    fedilink
    English
    29
    edit-2
    8 days ago

    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
    
  • @GenderNeutralBro@lemmy.sdf.org
    link
    fedilink
    English
    189 days ago

    vd (VisiData) is a wonderful TUI spreadsheet program. It can read lots of formats, like csv, sqlite, and even nested formats like json. It supports Python expressions and replayable commands.

    I find it most useful for large CSV files from various sources. Logs and reports from a lot of the tools I use can easily be tens of thousands of rows, and it can take many minutes just to open them in GUI apps like Excel or LibreOffice.

    I frequently need to re-export fresh data, so I find myself needing to re-process and re-arrange it every time, which visidata makes easy (well, easier) with its replayable command files. So e.g. I can write a script to open a raw csv, add a formula column, resize all columns to fit their content, set the column types as appropriate, and sort it the way I need it. So I can do direct from exporting the data to reading it with no preprocessing in between.

      • JackbyDev
        link
        fedilink
        English
        3
        edit-2
        8 days ago

        Came here to say both of these things. (Awk and “> simple”.)

        To be totally honest, I don’t think awk is any more complicated than something like grep, it’s just that regular expressions get used more often so they’re typically more familiar. In the same way that programming languages with c-like syntax (like Java and C#) often feel easier than ones that don’t (like Haskell and Clojure).