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.

  • gandalf_der_12te@discuss.tchncs.de
    link
    fedilink
    arrow-up
    1
    ·
    10 days ago

    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

  • toastal@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    11 days ago

    netstat -tunl shows all open ports on the machine to help diagnose any firewall issues.

  • gerdesj@lemmy.ml
    link
    fedilink
    English
    arrow-up
    1
    ·
    11 days ago

    ip eg:

    # ip a
    # ip a a 192.168.1.99/24 dev enp160
    

    The first incantation - ip address (you can abbreviate whilst it is unambiguous) gets you a quick report of interfaces, MAC, IPs and so on. The second command assigns another IP address to an interface. Handy for setting up devices which don’t do DHCP out of the box or already have an IP and need a good talking to.

    Oh and you can completely set up your IP stack, interfaces and routing etc with it. Throw in nft or iptables (old school these days - sigh!) for filtering and other network packet mangling shenanigans.

  • kyub@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    1
    ·
    12 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
  • gandalf_der_12te@discuss.tchncs.de
    link
    fedilink
    arrow-up
    1
    ·
    10 days ago

    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.

  • gandalf_der_12te@discuss.tchncs.de
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    10 days ago

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

  • helmet91@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    12 days ago

    Use less for checking contents of files. Many people use cat all the time, but I don’t like it, because if you do that often, your terminal window quickly gets flooded with stuff, and then you have to scroll up and down if you wanna see a previous output. With less, your file opens in a different “frame”, which you can close when you’re done.

    • deadcream@sopuli.xyz
      link
      fedilink
      arrow-up
      0
      ·
      12 days ago

      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.

        • deadcream@sopuli.xyz
          link
          fedilink
          arrow-up
          0
          ·
          11 days ago

          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.