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.
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 workstldr 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 descriptionLinux 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.
start from
man man
and learn to use man pages. Get used to lookup man pages for any topic before checking on the internetThis is it. You’re likely not going to get away from needing help from time to time. Instead of focusing on trying to know everything, focus on knowing where to find what you need. It’ll click from there with time.
Learning to read manpages is honestly the best advice. They are pretty dense in information, so maybe that’s why some people go to great lengths to run circles around them looking for inferior sources of information.
The tldr cli (tldr.sh) is a great way to get familiar with options of differ programs.
Very useful, even for someone who has been using Linux for many years. Sometimes you just forget or need that tool you rarely use.
tldr
can be much handier than parsing a man page when you’re in a pinch.I use the tealdeer implementation, but any is fine really.
- To learn Arch, install it from scratch (without archinstall), it’ll force you to read the Wiki and learn a lot of necessary commands in the process. After the installation, just keep using it. Using a Linux distro full-time as the only installed OS is the best way to keep at it and truly learn it over time. There’s no magic bullet here. Just keep using it and solving problems or issues as you go, learning more and more stuff as you go. If you need other OSses as well, run those in a VM. I don’t recommend dual-boot setups.
- Don’t blindly copy/paste commands you don’t understand. Always try to understand them first. Some commands can be very disruptive or even destroy your configuration. If you don’t understand it or are able to adapt it so that it fits to your particular configuration or system, you can EASILY damage a configuration, or even make your system unusable. Also, some people like trolling other people and deliberately share harmful commands. Generally, test potentially destructive commands or complex commandlines before actually running them.
- Document major config changes that you do. This is useful because you’ll be able to undo certain changes or even replicate your current system configuration fast when you change distros or have to reinstall in the future. For example my current Arch-based setup is fully documented in form of an almost-directly executable shell script. It does require some interactions but very little. If I ever have to reinstall this system, or upgrade my hardware, it can be done insanely fast and it’ll have the exact same configuration. This goes from basic partitioning and encryption all the way up to dotfiles and individual program configurations.
- Don’t feel the need to learn hard/advanced tools like Vim or Emacs unless you really think you’re getting an advantage from that and aren’t hesitant to put in the time and effort to learn them. Most people don’t need to use them. They’re amazing tools but you need to be prepared to lose quite a lot of time to learn them before you can become productive with them, and this might not be a tradeoff that’s useful for every single user. You can also get away with much simpler tools, like nano (as a console-based editor) or whatever programmer’s text editor you want.
- Similarly, whether a pure WM or compositor plus assorted tools compared to a full desktop environment is worth it for you or not, is up to you. There’s no wrong or right answer here. I’ve tried out pretty much everything and these days use KDE Plasma because I like the consistency and integrations and dislike having different, inconsistent stand-alone tools for panels, menus, notifications, wallpaper, file manager and so on. But again, there’s no wrong or right answer here. Just what makes more sense for you. It’s worth learning how to be able to configure and use a minimalistic setup, for sure. So trying it out doesn’t hurt and increases your knowledge overall. In general, in the Linux world it’s good to always know enough to not be screwed once some component suddenly doesn’t work anymore. For example, a competent Linux user should be able to deal with (temporarily) not having a GUI and fixing his system via commandline.
- A minimalistic, DIY distro like Arch can be amazing to learn everything, if you want to do that at least. If you just want a working desktop system with as little effort as possible, then don’t do that. But if you intend to learn every detail, then a distro like Arch is better suited for that goal than a “bloated”, fully pre-configured distro like Mint or Ubuntu is. Because Arch is much simpler on a technical level than those are. It’s much easier to understand e.g. the relatively simple package building process on Arch than it is on Debian/Ubuntu-based distros. But this “simple” explicitly refers to technical simplicity or minimalism. Most users expect something else when they hear “something is simple”. Arch is not simple as in beginner-friendly, but it is simple in terms of technical complexity, which is why many advanced users and tinkerers like it because it doesn’t stand in their way. It also means though that you HAVE to learn many things, e.g. how to configure a firewall, because it doesn’t come with any preinstalled by default. With Arch, the admin is supposed to know about everything and configure every component himself, at least on a somewhat basic level.
- If you want to go to even more details, you could also try out a source-based distro like Gentoo or Crux, which can also be a great learning experience, but it’s even more details regarding compilations of each package, dependencies, compile-time options, etc. you have to deal with than with a minimalistic binary-package-based distro like Arch, so whether that’s useful for you or not is up to you of course.
- While we’re at it: LFS (Linux from Scratch) is not a distro per se, it’s a guide on how to build your own distribution from scratch. It’s VERY time intensive and not recommended unless you truly want to learn how to build a complete distribution from scratch, or maybe start your own distro some day which isn’t based on another existing distro.
documented in form of an almost-directly executable shell script
I’m annoyed with myself for not thinking of doing this
- You can always use
man command
and just read through it. If you want less text, usecurl cheat.sh/command
(learn how to use aliases) or the toolstldr
andcheat
- Install the fish shell, it makes using the terminal waaay easier, out of the box.
- 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.
- 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
- There is this online terminal game/quiz but I cant find its name.
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.
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
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.
As I said. Fish can just be a shell. I only write bash scripts. All bash scripts have
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 enterexit
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.
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.
I dont get why you shouldnt use fish to run your daily commands, and bash for the scripts. I rarely do anything fancy in the terminal that would be bash specific.
I just learned about Fish from another Lemmy post and here it is again!
- You can always use
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.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.
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?
You learn by doing and by failing. Like we learned to walk, to write, to drive, to kiss, to speak a foreign language, or even to lace our shoes (and, yep, even that was a heavy trial and error process for toddler-us back then).
- Install Arch (in a VM, maybe) and while doing so read the Arch Wiki to understand each step, each action and the role of each app you’re asked to install. The Arch Wiki is an impressively well done documentation.
- Be fine knowing that it will take time to learn anything new (not just Arch, anything), you won’t get good at it the first time. Don’t rush it, take your time.
- Be fine knowing that you will face issues and will most likely fail at some point, be it to instal Arch or in doing whatever new. There is no other way to learn, for all of us, than by failing and then trying again, over and over. Once again like we learned to walk (by falling on our butt), to lace our shoes (by making a mess) or to kiss (by not doing it great at first).
Learning takes time and efforts. Perseverance, and humility. There is no shortcut to learning anything that is worth learning, not just Arch. But the reward is also so much worth it. Einstein had to learn calculus, Da Vinci had to learn how to hold a paint brush, and Tolstoy like Flaubert had to learn to write and I’m willing to bet they all made mistakes while they were learning their respective craft.
Even without referring to geniuses: the first time I tried to install Arch I ran away screaming and swearing I would never touch that thing again. The second time, I had already managed to read a good chunk of the relevant part of the wiki and used it constantly at each step of the process. I still failed at it but at least I understood why I failed and I felt incredibly more… in charge, despite me failing. The third time, I managed to have it running, and to install most the packages I wanted. That was great. There was no fourth time as, as much as I love Arch (which is a lot), I quickly realized using it that constant updates were not what I wanted from my OS and apps (I’m an old-ish user with very basic needs, I’m not even that much of a geek to be honest). So, I switched to the complete opposite of Arch (Debian, another great love of mine I must say). Still, learning and using Arch taught me a lot about Linux in general and about… myself.
This is really good advise and it all boils down to one attribute. Patience.
Don’t get disheartened when something does not work the first time. Take a step back. Look at what went wrong and then try again, hopefully without doing the same mistake again.
Learn the basic tools of Linux and Bash/Posix. cd, ls, cp, mv and rm are some very basic tools, but it is what we use 80% of the time.
This is really good advise and it all boils down to one attribute. Patience.
Thx. Yes, patience is key. As is the ability to
Take a step back.
Failing is fine because it’s not about us, it’s not personal. It never is. It’s about learning something and about the process.
I ran Gentoo for several years. It wasn’t Linux From Scratch but it did required a lot of manual work. It also had great documentation. It forced you to learn all of the pieces encompassing the entire OS.
Arch seems to be the modern equivalent.
Gentoo’s still around and quite modern. And USE flags are addictive.
I still find Tealdeer useful even now, it helps me get working with commands I know little about, more so than a manpage
Oh that’s pretty cool! Basically a better version of tldr?
Command line cheat sheet (with bonus vim controls):
rm -rf /
make computer faster(͠≖ ͜ʖ͠≖)
Wait I did this to my main drive everything went black is this suposed to happen? will it start working again?
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”
@Blisterexe @pineapple , after making a snapshot of VM. Sometimes, I do it just for fun and then roll back to the snapshot. Fun times.
it is a fun command to see happen, i agree
That’s kind of awesome, thanks!
And stop copy/pasting them. Type them out so you get used to them. It gets quicker the more you do it.
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”.Read and do! If it’s just a toy you play with sometimes, you might find learning harder. I find that making it your daily driver will motivate you to improve and fix things and in doing that you’ll learn.
What tips/ideas do you have for getting better at navigating the terminal, and getting a better understanding of how the os works
Running an OS as a virtual is liberating. Dive in, make mistakes, fix them (or not and have to reinstall or redo from the last save). No real consequences for exploring.
Linux is like kung-fu, mastery comes through practice
Learn the ways of Linux-fuInstall harder distros (preferably on bare metal) and use them. If you need to fix something, google it. This helped me a lot.
If you want to get better at Linux terminal and standard unix commands I would try https://overthewire.org/wargames/bandit/
It’s an interactive tutorial which will help build basic skills. There are a million guides and walkthroughs for this, but I would try each level on your own first before you look at a guide.