There is lots of books, videos and manuals about bash. So it is hard to tell if one is good or not. By advanced bash I mean regular expressions, complex scripts, and kind-of obscure options of basic commands no beginner tutorial tells about.

  • vas@lemmy.ml
    link
    fedilink
    arrow-up
    3
    ·
    edit-2
    4 months ago

    My personal basic tools for learning:

    • man bash. That’s the documentation for everything. It’s very careful and serious though, so sometimes you need…
    • Search in internet if you think your particular question is very “repeatable”. Stackoverflow used to be good, but now they’re all “AI AI AI by the way have you heard about AI?”. So I’m not recommending it anymore. For “advanced bash” there are pages that go over those “advanced topics”, too!
    • Run shellcheck to read your code and give suggestions/warnings. It’s a great tool for learning, too, besides the primary goal of reviewing code to be production-ready.
    • Sometimes, with extreme care, ask an LLM to review your code or give siggestions. It tends to hallucinate a lot, makes up wrong and unexisting stuff, but sometimes it’s useful, too. Especially at finding bugs. Again, it can be useful, but use with care. Oh, and it can actually be great at explaining, too. Throw it some syntax/code and it’ll explain wtf is going on. This part is very reliable and good.

    At my current level of experience I need mostly man bash, and occasionally all of the rest. Before I used a lot of stackoverflow and simply thinking of what I even want.

    • ScoffingLizard@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      1
      ·
      6 days ago

      I have a tough time reading man pages. It seems to be harder since everything went to systemd. After 20 years of Linux use, I still feel really dumb. I’m just now getting better with Vim keying.

      Is there a trick to reading man page formats? I’m a bit autistic and not an intuitive communicator. Sometimes I wish man pages had more example commands. I also wish there was a way to freeze the format at the top while scrolling options so I didn’t need to have 3 windows open to see format, scroll options, and have another open for actually typing.

      • vas@lemmy.ml
        link
        fedilink
        arrow-up
        2
        ·
        5 days ago

        Unfortunately I don’t think I know the answers to your questions. I do what you say: open one or multiple tabs in my terminal emulator if I need to read multiple parts at the same time. I press / and then type in some case-sensitive text if I want to search for occurrences of this text. Or I press ? and some text to search backwards. And the rest I “lamely” do with pressing up-down arrows…

        Learning by example is exactly the second layer I’m referring to in my text above. Man pages are very… formal. If I don’t yet understand what they even talk about, I need examples before their concepts become “native” to me.

        I can’t “teach” well really - but I’m explaining how this works for me. I used to hate man pages, now I love them. Even a very difficult one like man bash. There is a point in the learning curve where it gets a lot better…

        • ScoffingLizard@lemmy.dbzer0.com
          link
          fedilink
          arrow-up
          1
          ·
          4 days ago

          That’s still useful information. I use the Linux Command Library from FDroid. It is really good for seeing similar commands, variations, one liner examples, cheat sheets for Vim/Emacs, etc.

          I can recommend that for others like me who have trouble with commands.