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
    ·
    4 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

    • communism@lemmy.ml
      ·
      5 days ago

      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

  • harsh3466@lemmy.ml
    ·
    5 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

  • toastal@lemmy.ml
    ·
    4 days ago

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

    • kyub@discuss.tchncs.de
      ·
      4 days ago

      netstat is kind of deprecated, ss is more modern (from the iproute2 package) and uses very similar parameters.

  • DigitalDilemma@lemmy.ml
    ·
    5 days ago

    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.

  • jaxiiruff@lemmy.zip
    ·
    edit-2
    6 days ago

    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.

    • N0x0n@lemmy.ml
      ·
      6 days ago

      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.

    • BaumGeist@lemmy.ml
      ·
      5 days ago

      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 rows

      dd 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 or 3275G will take you to line 3275

      and 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 use n to search for the next occurence, or N to search for the previous

      That 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 and Esc 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)

    • Knuschberkeks@leminal.space
      ·
      5 days ago

      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.

  • gandalf_der_12te@discuss.tchncs.de
    ·
    edit-2
    4 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).

  • gandalf_der_12te@discuss.tchncs.de
    ·
    4 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.

  • wasabi@lemmy.eco.br
    ·
    6 days ago

    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.