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.
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.
-
Learn FreeBSD.
-
Learn Linux.
/s
-
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 theman
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.Install TLDR pages from your package manager to get easy access to the most useful information
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.
See if your library has “How Linux Works” - https://www.amazon.com.au/How-Linux-Works-Brian-Ward/dp/1718500408
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:
- Delimiters
- Syntax (Bash by default, but the syntax for whatever your chosen shell is)
- Switches
- Path (absolute and relative)
- 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.
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).
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.
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”.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.
+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.
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.
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
I think I will try something like manjaro first see what it’s like and then move onto arch.
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.
see this post for my experience with amd lol.
- 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.
- You can always use
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.
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.
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.
Another book rec: https://pragprog.com/titles/bhcldev/small-sharp-software-tools/
Explainshell.com is pretty useful for understanding shell commands you might find on forums.
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.
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.