this post was submitted on 02 May 2024
97 points (96.2% liked)

Linux

48031 readers
994 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

I've been using Linux for about 7 months now and have become a lot more comfortable using the terminal but I feel like there is more that I can learn.

Most of my work is done in a browser or DaVinci Resolve. I do try to use the terminal where possible but it's limited due to my workflow.

Are there any interactive sites where I can practice/learn the terminal? I'm going through Linux Survival at the moment.

EDIT: I forgot to add some important details.

I don't have a massive need for the terminal for my current workflow but I think it is important to know (looks good for any future job applications as well) and expand your knowledge on things that interest you when possible.

In the future, I hope to have a home lab/NAS running Linux. I will most likely SSH into that and I'd like to deal with any issues via the terminal.

I use Arch btw (technically EndeavourOS)

top 50 comments
sorted by: hot top controversial new old
[–] ProgrammingSocks@pawb.social 42 points 6 months ago (1 children)

I have never practiced using the terminal. The only way I learned was using the terminal to do my tasks and fix things when they broke.

In the future, I hope to have a home lab/NAS running Linux

Just start this project. That will teach you about how to use the terminal in a practical setting

[–] ProgrammingSocks@pawb.social 11 points 6 months ago (2 children)

Want to add a few things to try

  • Create a new file and edit it with nano.
  • Create and navigate directories
  • Copy a folder to another spot
  • Update your system and install a package with pacman
  • Start, stop, and check the status of a service. Maybe sshd
  • Use find and grep to find all files with a certain extension (this will involve the wildcard character *

This is just a small list off the top of my head. Doing your everyday tasks with the terminal is a great way to start to understand how it works.

[–] governorkeagan@lemdro.id 2 points 6 months ago (1 children)

Use find and grep to find all files with a certain extension (this will involve the wildcard character *

I definitely need to practice using find and grep. When I do need to use them I almost always need to look up the command

[–] Andromxda@lemmy.dbzer0.com 4 points 6 months ago* (last edited 6 months ago) (3 children)

BTW fd and ripgrep are a little easier to use. They're also much faster and more modern. You can find more modern alternatives to classic Linux command line tools in this blog post or in this list on GitHub.

load more comments (3 replies)
load more comments (1 replies)
[–] hungover_pilot@lemmy.world 31 points 6 months ago (1 children)

This website has a bunch of great practice "wargames". You'll learn a bunch about common linux commands and the different options for them. It also provides you with some great tips on what to google if you get stuck. I reccomend starting with bandit.

https://overthewire.org/

[–] joshcodes@programming.dev 5 points 6 months ago

I recommend this to everyone I meet in tech, it's really good to learn linux and file system skills

[–] Vendetta9076@sh.itjust.works 23 points 6 months ago (1 children)
[–] governorkeagan@lemdro.id 3 points 6 months ago (1 children)

This is exactly what I’m looking for, thank you!

[–] Vendetta9076@sh.itjust.works 4 points 6 months ago* (last edited 6 months ago) (1 children)

Glad to help :)

Also absolutely start your homelab. Its how I crash coursed everything and its the template I use to teach others about linux.

load more comments (1 replies)
[–] minimalfootprint@discuss.tchncs.de 23 points 6 months ago (1 children)

Not specific for learning, but you can put any command into ExplainShell and it breaks down the individual parts for you.

[–] governorkeagan@lemdro.id 6 points 6 months ago

That's super useful, thanks!

[–] 8263ksbr@lemmy.ml 15 points 6 months ago* (last edited 6 months ago)

In m opinion, practicing with real life problems is the best teacher. There are some ways to cut and convert videos, audio and images via terminal. Maybe there is still a way to enrich or streamline your workflow with that. Maybe a script which will prepare the folder of your next project. Also, xdotools let you automate a lot of sometimes tedious routines.

[–] Andromxda@lemmy.dbzer0.com 11 points 6 months ago (1 children)

The Linux Experiment fairly recently made a video about this: https://tilvids.com/w/w5SrXQUhk1a5iEtE9xPWgS

If you just want the links:

I also recommend learnlinux.tv and especially the YouTube channel

Since you're on Arch, the Arch Wiki is a great resource if you ever need to look something up. If you just want to improve your CLI skills and make the life in the Terminal more pleasant, I'd recommend the fish shell. (Check this out if you want a video demonstration) It has a great autocomplete feature and shows you a short description of each command, which might help you to learn more about it. It's also very flexible and customizable. (Check out this video for some neat tricks) My last recommendation is tldr, it's a very useful application that gives you a short summary of how to use a command. These summaries are much easier to read and understand than manpages. I assume you know about manpages, if not, that's another recommendation.

[–] PipedLinkBot@feddit.rocks 2 points 6 months ago

Here is an alternative Piped link(s):

the YouTube channel

this

this video

Piped is a privacy-respecting open-source alternative frontend to YouTube.

I'm open-source; check me out at GitHub.

[–] Ramin_HAL9001@lemmy.ml 10 points 6 months ago* (last edited 6 months ago) (1 children)

As many here have said, but I will emphasize: learn the Bash programming language. Linux Survival is a very good start, and you can just start experimenting right away in your own terminal on your own computer.

To go more in depth, you can read through the manual on your computer by typing "info bash". The Info documentation browser is a command line app. You may need to install it using your package manager ("apt-get" or "pacman" or "dnf").

In the "info" app, you can navigate with the arrow keys, pressing enter on hyperlinks, typing l (lowercase "L") works like the "back" button in a web browser, typing r (lowercase "R") works like the "forward" button. Info also lets you search the index by pressing i (lowercase "I") then entering your search in the prompt, or search the full text by pressing s and entering your search in the prompt. And q quits back to the command line prompt. "Ctrl-Z" pauses the "Info" app and drops you back into the command line, and you can resume your "info" session using the "%" (percent sign) command.

Another thing that can help is to learn about the GNU "Coreutils", this is a suite of commands usually installed into /usr/bin or /bin which provides helpful command line utilities. These are commands like cat, wc, sort, cut, ls, du, cp, ln, chmod and many others. Read through the Coreutils Info manual by typing "info coreutils".

And I will also reiterate recommendations from others: learn how to use Vim and/or Emacs. Vim has the more difficult learning curve but is extremely useful for writing scripts. Emacs is better though because it lets you split-screen with manual pages, and copy-paste commands between Man pages, "Infodoc" documents, the shell, and/or a text file, all using only keyboard commands. I think it makes it much easier to learn since everything is integrated together. Ask the Emacs community how to get started if you are interested.

[–] governorkeagan@lemdro.id 3 points 6 months ago

Thank you for such a detailed response.

I've tried learning Vim previously but I never really gave it as much time as I should have. I haven't tried Emacs yet, I'll have a look at that as well.

[–] bloodfart@lemmy.ml 9 points 6 months ago (2 children)

Cost: $10

One year of a small vps. Fiddle around with it, get it secure, run some services on it, flatten and reinstall through the web kvm when you fuck up.

Look at your logs and be terrified at how many computers are just out there poking and prodding at random ips on the internet.

Say “I’m in” and push play on squarepusher when you log in.

[–] meteokr@community.adiquaints.moe 4 points 6 months ago* (last edited 6 months ago) (1 children)

Pardon me for asking, but this looks very strange. 10$ a year, when most VPS hosts I see are 5$ish a month, and the website is default WordPress stuff with literally nothing in their knowledge base, and two blog posts. Also your link is to https://cloudserver.net Where as when I lookup the name, https://www.cloudserver.net/. A totally different looking website. What is this?

[–] bloodfart@lemmy.ml 6 points 6 months ago (1 children)

It’s the link from lowendbox.com’s list of cheap vpses. I’ve used a few of em including cloudserver and they’re fine. Cloudserver actually did the most kyc stuff out of any on that list.

Idk why the link is different or any of the stuff you’re talking about. It’s old, November of last year, but it still seems to work.

[–] meteokr@community.adiquaints.moe 3 points 6 months ago

Oh that's a cool resource, thanks for the share.

load more comments (1 replies)
[–] hagar@lemmy.ml 9 points 6 months ago (2 children)

I think you might like DIstroSea. If you'd like to persist your experiments, then likely learning how to emulate systems with QEMU or VirtualBox (the latter if you'd like a friendlier GUI-led experience, the former if you want to go full-CLI virtualization). QEMU is great in how lightweight and easy to create and discard self-contained VM disk images can be.

[–] wildbus8979@sh.itjust.works 6 points 6 months ago (1 children)

I will repeat it once again... Why would you use subpar Type 2 virtualization and DKMS with VirtualBox when there's a perfectly viable UI for the kernel's built-in Type 1 hypervisor (Qemu being the userland): https://virt-manager.org/

[–] hagar@lemmy.ml 3 points 6 months ago (1 children)

I'm not the biggest fan of VBox either, it's just very popular and full of sequential "wizards" to guide the user along the process of creating VMs, so it might be one way to get started. I'd much rather work with QEMU though.

[–] wildbus8979@sh.itjust.works 3 points 6 months ago

Virt-manager is a complete full UI for Qemu (and lxc and Xen) which works essentially the same way. It's been around since 2009.

[–] governorkeagan@lemdro.id 2 points 6 months ago (1 children)

That looks interesting. I like the idea of trying to emulate a system only using the command line - I learn a lot from hands-on projects like this

[–] hagar@lemmy.ml 10 points 6 months ago* (last edited 6 months ago) (1 children)

That might be fun then.

QEMU can be as simple as this:

qemu-img create -f qcow2 mydisk.qcow2 20G

Here you are first creating a disk image with the format qcow2 and maximum 20G capacity. This is a QEMU disk image format that will take up very little space and grow as you use up the VM disk.

qemu-system-x86_64 -m 256M -cdrom alpine.iso mydisk.qcow2

This will start a VM with 256MB of RAM, the alpine.iso image in its virtual CD/DVD slot, and the disk image you just created as a virtual drive. This will come with networking enabled by default, so you'll have internet access from within the VM.

It should now drop you into the Alpine installation. Alpine is very lightweight so it's great for experimenting, but you could do virtually the exact same for most other flavors of Linux and BSD images out there.

Once you are done installing, you can power off the VM and then start it with this:

qemu-system-x86_64 -m 2G mydisk.qcow2

That's basically the same without the -cdrom argument, this time with 2GB of RAM. I find QEMU a delight to play with because it has sane defaults like that. Hope you have fun too!

[–] governorkeagan@lemdro.id 3 points 6 months ago

Thank you for such a detailed breakdown! I'll give all of this a go over the weekend.

[–] gandalf_der_12te@discuss.tchncs.de 8 points 6 months ago (1 children)

IMO the best knowledge comes from doing practical examples that actually interest you. I wouldn't rush that.

[–] SidewaysHighways@lemmy.world 6 points 6 months ago (1 children)

This is the crux of my whole life. If I am not interested in something, my entire existence will basically refuse to soak up that knowledge or even try to empathize. It can sometimes suck. I have to walk away if people start engaging in conversations about sports.

It got easier to start digging into CLI after realizing that would be an easy way to get the home media server up and running. And managing local game servers.

It's a little harder to focus on vlans and firewall rules, outside of the repercussions of not setting that up correctly.

load more comments (1 replies)
[–] kureta@lemmy.ml 8 points 6 months ago

As many people have already said, just do what you need to do. That's the best way to learn. But if you are afraid you'll break your system with dangerous commands, use docker or a virtual machine for practice.

[–] palordrolap@kbin.social 7 points 6 months ago (2 children)

Most terminals start a shell as the first program, so you're not really learning "Terminal" so much as whatever program it starts first. Bash is a pretty common shell, so you might want to search for things like "Bash examples" to get a feel for it.

If that's too simple, or you blast past that, then reading bash's manual might give you some more ideas. The man command is your friend. The manuals are not necessarily quite so friendly, but they're aimed at someone who's already somewhat competent.

Anyway, here's one link from a Bash examples search I did: https://linuxsimply.com/bash-scripting-tutorial/basics/examples/

If Bash isn't what you have where you are, substitute its name instead. Zsh and Fish are pretty popular. There are others, but I don't think any mainstream Linux uses them by default.

To check what shell you're using try an echo $0 or echo $SHELL.

Finally, a bit of advice: Don't go running commands you see on the Internet unless you're sure what they're going to do is something you have no problem with. And be careful with copy/pasting from web pages you don't know or trust - I can't vouch for the examples in the link I gave earlier, for example. It's possible to make things look like a completely innocent command but when pasted does something else entirely.

[–] Shareni@programming.dev 3 points 6 months ago (1 children)

And be careful with copy/pasting from web pages you don’t know or trust

:(){:|:&};:

[–] palordrolap@kbin.social 3 points 6 months ago

This is the sort of thing I was talking about with "Don't go running commands [...] unless you're sure what they're going to do [...]"

I did a breakdown of this one on the snoosite back in the day. Searching "fork bomb" on YouTube is probably a better way to get that breakdown these days.

[–] governorkeagan@lemdro.id 2 points 6 months ago (1 children)

I’ll definitely give man some more love. Thanks for the advice

[–] Shareni@programming.dev 3 points 6 months ago (2 children)

Check out tldr as well. I generally use it far more often than man

load more comments (2 replies)
[–] Synnr@sopuli.xyz 7 points 6 months ago (2 children)
load more comments (2 replies)
[–] bizdelnick@lemmy.ml 6 points 6 months ago

Try to avoid using any file manager (uninstall them all if it is difficult to avoid running them). So you will practice in using file manipulation commands.

[–] CorneliusTalmadge@lemmy.world 6 points 6 months ago

Cmdchallenge is similar to Linux survival. But is mostly command line basics like moving around directories, searching, etc. It also gives a list of solutions that people have used for each exercise, which is interesting just to see different ways of doing things.

[–] NeoNachtwaechter@lemmy.world 6 points 6 months ago

I believe it isn't the terminal. You are looking for the shell. On arch, it is bash.

man bash

And then, because man pages are too hard for beginners, google for some bash tutorials.

In addition, you want to learn vi. One of the greatest tools of all times after 1969 :-)

[–] michaelgarydean@lemmy.world 4 points 6 months ago* (last edited 6 months ago)

Check out Raspberry Pi. Set up a streaming server, NAS, cloud storage. If you're interested in media, make an installation. There's tons of great projects available and I believe the best way to learn anything is by making something real, not just practicing random commands. Since it's Linux based, you'll learn a lot of practical uses of Linux and the power of being able to script Bash files.

https://www.raspberrypi.com/documentation/

Hope it helps.

[–] cyberpunk007@lemmy.ca 4 points 6 months ago

Use a virtual machine inside virtual box, or docker, or some other container. Back when I started the os could literally break to CLI and I've have to learn to fix it with Google and another computer or my phone 😅. Instead of blindly pasting commands, read the man pages. After years I have a handful of useful commands I use and I really do find it easier to do certain things from cli vs GUI. It will come with time, don't worry.

[–] possiblylinux127@lemmy.zip 4 points 6 months ago
[–] mub@lemmy.ml 3 points 6 months ago (1 children)

What, things like sudo rm -f /

load more comments (1 replies)
[–] just_another_person@lemmy.world 3 points 6 months ago

VM or Container is easiest, depending on what you want to do.

[–] refalo@programming.dev 2 points 6 months ago
[–] Maoo@hexbear.net 2 points 6 months ago

I recommend installing a Linux distribution that requires a hands-in approach like Gentoo or Linux from scratch. If you don't have an extra computer you can do it on a virtual machine on the computer you do have.

The process will require you to use the various incantations and rituals of using the terminal. As you do so, learn what they do by googling them or using their man page.

For more practice, write a shell script or otherwise choose a task you want to do using the terminal like browsing through your files or searching for a file whose name matches a pattern and so on.

load more comments
view more: next ›