I am a Linux beginner/amateur and I have sort of had enough of copy and pasting commands I find on the internet without having a good understanding of how they actually work.

I guess my end goal is to be able to comfortably install and use arch Linux with my own customization’s and be able to fix it when things go wrong.

What tips/ideas do you have for getting better at navigating the terminal, and getting a better understanding of how the os works. What is a good roadmap to follow? And how did you, advanced Linux user, get to the stage your at now?

Edit: my current distro is bazzite just in case you were interested and thanks for all the replies you are all really helpful.

  • fragrantvegetable@sopuli.xyz
    link
    fedilink
    arrow-up
    0
    ·
    19 days ago

    Haven’t seen anyone mention https://overthewire.org/wargames/bandit/ yet. It’s a Linux shell game where you need to solve problems using shell commands that only requires an ssh client on your machine: you ssh into the first server, solve a problem, and the solution points you to the next server. It starts easy (e.g. read out this file using cat) but gets hard quickly. But you can always look up solutions when you’re stuck. It gives a good idea what certain commands are used for and how they can be combined in powerful ways.

    • Yppm@lemy.lol
      link
      fedilink
      English
      arrow-up
      0
      ·
      19 days ago

      This reminds me of a site called hackerslab back in the 2000s. I think you had to ssh in to some Korean server and try to get the password for the next level.

  • DickFiasco@lemm.ee
    link
    fedilink
    arrow-up
    0
    ·
    20 days ago

    It sounds a bit nerdy, but dedicate some time just to learning a specific command once in a while. Start with something straightforward like ls. Read through the man pages and try out all the different options for it. After a while, you’ll master quite a few commands and will be able to string them together to perform more complex tasks. It’s definitely easier learning the system piece by piece like this. I used to learn by just jumping right in to a complex task, but I ended up with just a superficial understanding most of the time. Now days I try to be more deliberate about reading all the documentation and actually learning the tool/command/etc.

    Also, Arch has the archinstall script that greatly simplifies the install process if you need it. You’ll definitely learn more doing it manually though. I’ve been using Arch as my daily driver for a year now and I love it.

      • pineapple@lemmy.mlOP
        link
        fedilink
        English
        arrow-up
        0
        ·
        18 days ago

        Wait I did this to my main drive everything went black is this suposed to happen? will it start working again?

        • Blisterexe@lemmy.zip
          link
          fedilink
          arrow-up
          0
          ·
          18 days ago

          in case you aren’t joking, rm -rf / (albiet with a warning now) will delete allll the files on your system, so everything going black is the expected result.

          rm is remove, the - is to indicate that you want to pass arguments, and r&f are recursive (delete stuff in the folders in this folder) and force (don’t ask for confirmation). The slash afterwards designates the root folder, the folder with everything in it.

          So “rm -rf /” means “remove, recursively and forcefully, everything in the / directory”

  • Snot Flickerman@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    20 days ago

    For one, stop copying and pasting commands and start learning about the basics of the shell.

    Here’s a basic tutorial from UC Berkeley: https://computing.stat.berkeley.edu/tutorial-using-bash/

    Things you’ll want to focus on:

    1. Delimiters
    2. Syntax (Bash by default, but the syntax for whatever your chosen shell is)
    3. Switches
    4. Path (absolute and relative)
    5. Operators (Pipe will become one of your most heavily used)

    Then once you learn to do some basics, I would hammer repetition. Just force yourself to do things you would usually do via GUI by command line. I started with the basics of updating my system way back in the day with sudo apt-get update && upgrade

    Just type type type type all those commands until remembering them is muscle memory.

    • thingsiplay@beehaw.org
      link
      fedilink
      arrow-up
      0
      ·
      19 days ago

      Just type type type type all those commands until remembering them is muscle memory.

      For learning purposes, also try not to use aliases. Because using alias would undermine the learning process of knowing what and how its been done. I recommend (as you said) typing it out over and over again and use aliases on a later stage of your Linux learning only (maybe after weeks at least).

      • Snot Flickerman@lemmy.blahaj.zone
        link
        fedilink
        English
        arrow-up
        0
        ·
        19 days ago

        Exactly, shortcuts like aliases or tab completion really should be saved for after you’ve familiarized yourself, so you’re less likely to make a mistake or tab complete to the wrong command etc.

  • Max-P@lemmy.max-p.me
    link
    fedilink
    arrow-up
    0
    ·
    20 days ago

    Just don’t copy paste the commands. Really! Just take the time to understand what the command does, read the manual, and rewrite it yourself instead of pasting it. That alone will help a fair bit and can start guessing what it should be.

    After a while of doing that it stops being a “paste this command to make the service run” and becomes “ask systemd to enable and start the service”. You start associating editing files in /etc with “will probably need to slap a sudo in front of that one”, you start mentally replacing nano/vi/vim/emacs/nvim/sed with your preferred way of editing the file, because you absorb the concept of “this command edits a text file”.

  • LambdaRX@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    20 days ago

    Just install Arch, when You follow wiki it’s not that hard. if You will make mistakes during the process, You will gain better understanding of how things works while fixing errors.

    • oo1@lemmings.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      19 days ago

      +1. and yes use the wiki not the install script.

      I think theres value to anyone with a genuine interest if they just have a go at an archinstall - I think they can setup most things of interest in a Qemu(vm), or a spare partition, or even a usb or something. Theres nothing to lose but time. I’d recommend the user knows enough about their disk setup and their incumbent boot manager so as not to screw up their main os. Though i’m very tempted to say that’s a rite of passage.

      Of course everyone already has a regular backup(s) which contains some sort of list or script for all the software, configs and tweaks they normally do. If not - well another rite of passage.

    • Diplomjodler@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      19 days ago

      Certainly a worthwhile endeavour. But I’d recommend doing it in a VM or a secondary machine before jumping right in on your main computer.

    • annoyed-onion@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      20 days ago

      This. The arch wiki is a treasure trove of information. The more you do, the more you’ll learn.

      Also, don’t blindly copy paste configs for editors or window managers. Just slowly build them up based on your own use. It’ll be painful initially but worthwhile in the long run

      • pineapple@lemmy.mlOP
        link
        fedilink
        English
        arrow-up
        0
        ·
        19 days ago

        I think I will try something like manjaro first see what it’s like and then move onto arch.

        • radswid@feddit.org
          link
          fedilink
          arrow-up
          0
          ·
          19 days ago

          That was exactly how I did it some years ago. After 4 or 5 times fixing the X-server after an update (thanks nVidia!) I switched over to Arch. Installed Arch following the Wiki for about 2 hours… failed and started the process of installation again (in about 1.5 hours :P) and succeeded. By failing and trying again I’ve learned a ton. My advise for less frustration: go with Team Red. In my experience AMD graphics cards are much more linux-friendly.

  • boredsquirrel@slrpnk.net
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    20 days ago
    1. You can always use man command and just read through it. If you want less text, use curl cheat.sh/command (learn how to use aliases) or the tools tldr and cheat
    2. Install the fish shell, it makes using the terminal waaay easier, out of the box.
    3. Install Alpaca flatpak, and use tinyllama or bigger LLM models. Tinyllama is already very sufficient at explaining linux commands and more, and runs fine on my reasonably powerful and modern laptop. Other models may be slow as fuck.
    4. Use the terminal only. Log out, Ctrl+Alt+F2 and login, then use some tools.
    $pwd
    cd
    echo
    ls
    cat
    nano
    less
    more
    chmod
    chown
    #your package manager
    lsblk
    dd #be careful!
    udisksctl
    lsusb
    lspci
    curl
    wget
    ...
    

    Note: use the man for these tools and often multiple tools do the same thing

    1. There is this online terminal game/quiz but I cant find its name.
    • thingsiplay@beehaw.org
      link
      fedilink
      arrow-up
      0
      ·
      19 days ago

      Install the fish shell, it makes using the terminal waaay easier, out of the box.

      Not a good idea if the goal is to learn more about Linux. Fish is not compatible to and is different to Bash in some ways, that it would be hard once not using Fish. Also getting help or sharing scripts with others will be problematic, when having a problem and researching it. For someone coming in to Linux and wanting to learn about it, I highly recommend to learn about Bash first and use it at least for months before even thinking about a custom shell. I used Fish too (and I miss some features), so its not like I wouldn’t know what it is.

      Install Alpaca flatpak, and use tinyllama or bigger LLM models.

      Alpaca is nice. GPT4All is also another one (and one that I prefer). Either way, both are good. But again like previous point, I do not recommend to install and use Ai modesl (LLMs) to learn about Linux and to get used to it. Especially the smaller models often hallucinate and lie with false claims. If you don’t know it better and are currently learning, this could be a problem. I highly discourage from installing and learning with an Ai model alongside when you are new to a topic like Linux. Its also not like there wouldn’t be enough good material out there anyway.

      • boredsquirrel@slrpnk.net
        link
        fedilink
        arrow-up
        0
        ·
        19 days ago

        Fish is just a shell, you can still write and execute bash scripts

        Fish is rewritten in Rust btw

        Also the syntax is waay better, it should totally replace bash

        • thingsiplay@beehaw.org
          link
          fedilink
          arrow-up
          0
          ·
          19 days ago

          My point is that Fish is not standard Linux tool. If the goal is to learn more about Linux, it makes more sense to learn about Bash first. I’m not against Fish. For a newcomer its just confusing when researching stuff or reading others scripts in Bash and constantly think about the differences in Bash and Fish. Or if you want to share a script with someone who does not have Fish. I’m not saying Fish is bad or anything like that. I’m just saying for a newcomer its not a good idea to ignore Bash and learn Fish first for someone who is interested into learning more about Linux and its eco system. Fish itself has the better language, no doubt about it and is actually better than Bash. But the quality is not my main concern in the reply.

          • boredsquirrel@slrpnk.net
            link
            fedilink
            arrow-up
            0
            ·
            19 days ago

            As I said. Fish can just be a shell. I only write bash scripts. All bash scripts have #!/bin/bash at the beginning so it doesnt matter.

            I dont know about fish errors. If something doesnt work, I enter bash and then run it again. I enter exit when I am done.

            That does happen but the workaround is easy

            Apart from that, instant suggestions, history, arguments and available commands already help a lot.

            • thingsiplay@beehaw.org
              link
              fedilink
              arrow-up
              0
              ·
              18 days ago

              Fish can just be a shell. I only write bash scripts.

              That’s the exact problem. You deal with two languages. I did that too BTW. Now for someone who is experienced, its fine. But for someone who just started learning about Linux and scripting, its not ideal, as it adds unnecessary complications and friction for a learning process that is already complicated. Because learning Bash is a must do in my opinion. Regardless what custom shell you use.

              After that learning process and getting familiar, one still can decide to use Fish as the interactive shell. But that’s AFTER the initial learning process of the basics of Linux.

  • colournoun@beehaw.org
    link
    fedilink
    arrow-up
    0
    ·
    19 days ago

    If you’re not already, use it as your main system. Don’t dual boot. Stop using windows and mac. When you run into something you need to do, figure out how to do it on linux. It will be slow going at first, but after a few months you will pick up more productivity than you had before.

    Another commenter recommended the fish shell, but I disagree because fish is not posix compliant. Almost all of the shell script examples that you will find assume posix compatibility and will usually have to be modified to run with fish. Once you get comfortable with a posix-compliant shell, then maybe consider fish or another “modern” shell.

    On the topic of shells, read the bash manual. It’s long and informative. You don’t have to memorize it, but be aware of the different concepts there, and refer to it when you need to. It’s pretty horrible as a programming language, but it’s what glues most of Linux together.

    • pineapple@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      19 days ago

      I am still dual booting because some games I play just don’t work properly but other than that I am doing everything I can on Linux.

      • thingsiplay@beehaw.org
        link
        fedilink
        arrow-up
        0
        ·
        19 days ago

        To be honest, this is my recommendation as well. If you kill Windows and can’t play your favorite games, then its more likely to give up Linux.

  • electricyarn@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    19 days ago

    When you are doing stuff in the terminal write it down somewhere else also, on a piece of real life paper or in a simple text document or whatever works for you.

    In general I found taking notes while trying to do things in the terminal helped me learn.

  • NiaKitty@beehaw.org
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    18 days ago

    Just giving my +1 about what others have said:

    in terminal man to get an overview of a command and usage, tldr.sh is a “tldr” of those same man pages simplified and very user friendly, and apropos to search man pages by description to find tools that do what you wanna do.

    Ex usage:

    man ls gives an overview of how ls works

    tldr ls gives a quick user friendly overview of how ls works (after installing it, or using the site tldr.sh)

    apropos compress will search man pages and output a list of commands that have “compress” in the description

    Linux has an overwhelmingly large amount of commands or things you can do, it’s good to learn a subset of common things, but arguably more important to learn how to quickly find info on the fly using tools like the above to reference as you do things. I’ve used Linux for about a decade, but still only use the same 5-10 or so commands regularly in the terminal, and look up anything else whenever I need.