Hello fellow Linux Lemmings!

I’ve been tasked with putting together a 20 hour class for “Introduction to Linux” and I’d like to solicit your opinions for topics that should be covered.

The class is targeted for at least minimally technical people - maybe developers, or future developers, but regardless of background they’ve never seen or worked with Linux before.

I plan to do a VERY short overview of installing Linux (to a VM - so they have a “real” environment to learn with) and the GUI but the primary focus will be CLI. Imagine tools and tasks you come across while working on a “real” server (or VM).

A high level overview of the topics I currently have allocated is :

  • Super brief history of Linux
  • Benefits and use cases of Linux
  • General overview of the file system and the purposes of the pre-defined directories (/dev, /proc, /etc, /home, /bin, etc)
  • “Everything is a file”
  • File extensions don’t matter (windows users : )
  • Note on responsibility - you can delete “in use” files. It will do exactly what you tell it with sometimes minimal guardrails.
  • Everything from here down is CLI only!
  • What is a terminal/CLI and how do we use it?
  • How do we navigate the file system using the CLI
  • How to list, create, copy, move, delete, and read files/directories
  • EDIT: Basic file editing with nano
  • How to search for files (find… maybe locate)
  • Archives and compression (tar, gzip, bzip2)
  • Overview of permissions (read/write/execute, owner, group, chmod, chown)
  • Brief overview of different shells (bash, zsh, etc)
  • How to get help on the CLI (man, info, --help)
  • Tab completion, history
  • Shortcuts / control codes (ctrl+c, ctrl+d, ctrl+a, ctrl+e, and coverage of ctrl+z later)
  • grep
  • Checking processes (top, ps, kill)
  • Signals (sigterm, sigkill, etc - related to kill above)
  • Backgrounding and multitasking (ctrl+z, fg, bg, jobs, nohup, &)
  • Linking (ln)
  • STDIN, STDERR, STDOUT and redirection
  • Redirection (>, >>, <)
  • Command pipes ( | )
  • How to access a remote machine via SSH with UN/PW
  • How to access a remote machine via SSH with key auth (think cloud VMs like EC2)
  • Administrative commands and tasks (su, sudo, how it works, when to use it)
  • Add users and groups
  • How to change your passwd (maybe how to change your default shell too)
  • Restart, shutdown, halt
  • How to install/remove software (package managers, packages, pre-compiled binaries, maybe compilation with make if time allows)
  • Configuring your profile for customizing your environment
  • ENV variables and aliases
  • Network information (ifconfig) and tools (curl, wget, netcat, etc)

Everything from here down is “extra” if time allows (AKA - ensuring I don’t run out of material :)

  • Encryption (gpg - symmetric and asymmetric)
  • Backups (rsync, maybe dd)
  • screen/tmux
  • How to setup key based logins/auth
  • EDIT: More advanced CLI text editing with vim
  • sysreq commands
  • srm/shred
  • Shell scripting basics
  • init vs systemd, how to start/stop/status services.
  • Maybe how to create a simple service
  • Run levels
  • sed, awk basics
  • File system types, file system checking, formatting… I hesitate to get into partitioning but it’s always an option if I need it.
  • Alternatives to well known win/mac utilities and how to find them. EG: GIMP to replace Photoshop.

What do you think?

Did I miss anything that you deem super important?

Anything that I should definitely keep in the “only if I run out of material” category?

O, and if you have any good ideas for practical exercises I’d love to hear those too. I want to keep them <15min but things like “create a new directory, cd into it, touch a file, list the contents of / and write the output into the file you just created” are perfect.

Thanks!

  • Lantern@lemmy.world
    link
    fedilink
    arrow-up
    15
    ·
    1 year ago

    You should probably explain what a distribution, a DE, a WM, and a DM are. I feel like this is something that Windows users lack in particular, as they have little control over these features.

        • clif@lemmy.worldOP
          link
          fedilink
          arrow-up
          3
          ·
          edit-2
          1 year ago

          That is an excellent idea on time management.

          Yes - I’m planning to walk them through a real install to a VM and have them follow along so they have a local instance that they can play with on their (win or mac) system. It requires me to spend a little extra time for setting up VirtualBox, but I think it’s worth it since they can then play along and experiment as we discuss each topic. I know that’s how I learn best - you can tell me something multiple times but it’s only when I truly do it that it’ll stick in my memory forever.

          Covering the intro, history, etc would be perfect topics to go over while the install runs.

          EDIT : I should point out that I’m going to distribute thumb drives to the students that will contain VirtualBox (win+mac) installers, a Linux ISO that we’ll use (probably Ubuntu), as well as that thumb drive being a live Linux bootable drive in case they ever want to plug & boot without using a VM. This will hopefully cut down on wasted class time for “now everybody go download this 4GB ISO” - they’ll already have it available and all in the same drive/directory/etc for every student. From past teaching experience, there’s always at least one that doesn’t come prepared with downloads and such no matter how much I harp on it… that and the ever present “I saved it somewhere and now I can’t find it” 😆

  • eeleech@lemm.ee
    link
    fedilink
    arrow-up
    13
    ·
    1 year ago

    I would consider that ifconfig is deprecated on many distros and would therefore teach about iproute2 (mostly the ip and ss commands) instead. Additionally I would consider editing files essential, even if it is with nano.

    Maybe mention more modern and simpler help tools like tldr, as they could be even more useful to beginners.

    To introduce the shell and utilities, I would try to find a somewhat realistic use case that combines multiple aspects, like analyzing some files or spellchecking instead of simply mentioning every feature one by one.

    • clif@lemmy.worldOP
      link
      fedilink
      arrow-up
      6
      ·
      1 year ago

      Now I’m learning something. I’ve defaulted to using ifconfig for so many years I didn’t even realize that ip and ss were around. I’ll look into them, thanks for the pointers.

      And yeah, good idea on file editing. Maybe I should move nano up to the essential category for basic editing and keep vim in the “extras” since it takes a little more training to use effectively, while providing a lot more functionality if you know how to take advantage of it : D

      • eeleech@lemm.ee
        link
        fedilink
        arrow-up
        7
        ·
        1 year ago

        Keeping the details about vim in the extras is what I would do as well, but I would definitely tell the students that vim and vi exist, because they are the only editors available on many systems.

  • selokichtli@lemmy.ml
    link
    fedilink
    arrow-up
    11
    ·
    edit-2
    1 year ago

    It’s too much for 20 hours, if it’s introductory. Also, wouldn’t you want to teach them how to actually install Linux?

  • mvirts@lemmy.world
    link
    fedilink
    arrow-up
    10
    ·
    1 year ago

    For the love of God make them all practice using tab completion in shells, and show them nice shells that do completion for command options. I spend a significant amount of time dictating commands that could be completed by the shell 😅

    • russjr08@outpost.zeuslink.net
      link
      fedilink
      English
      arrow-up
      6
      ·
      1 year ago

      Also, some of the other bash/readline niceties - like Ctrl+r for reverse-search, or Ctrl+x Ctrl+e to open the currently typed in command in $EDITOR (saving will execute the command). Good for when you have one of those really long commands and you have to do some more extensive editing.

  • atlasraven31@lemm.ee
    link
    fedilink
    arrow-up
    8
    ·
    edit-2
    1 year ago

    With files, include user and group permissions (read, write, execute).

    You could talk briefly about the FOSS philosophy.

    • clif@lemmy.worldOP
      link
      fedilink
      arrow-up
      6
      ·
      edit-2
      1 year ago

      Ah, great point on FOSS. I know I have it in my original notes somewhere but I need to be sure it makes it into my outline.

      I added chmod and chown into the permissions bullet.

    • jagungal@sh.itjust.works
      link
      fedilink
      arrow-up
      4
      ·
      1 year ago

      I like this idea, but I think you should work a bit of history/philosophy into each lesson by explaining why things work the way they do. The students are unlikely to engage with a history of a system they’ve never used before, so starting with that will lose their attention before you’ve even gotten it. Giving them a bit at a time means that they will slowly build a mental model of how *nix works and is built.

  • snowraven@sh.itjust.works
    link
    fedilink
    arrow-up
    6
    ·
    1 year ago

    I think you’ve got it all covered. But for my 2 cents: maybe resources to keep them engaged after these classes, a beginner’s book like “the command line by william schotts” might be an Excellent resource to recommend.

    Throwing in a word for foss as someone else is also a nice idea. It would be even better if you could relate it your own life. For example - I use tons of custom scripts for purposes like creating automated git backups and syncing my gdrive using rclone. If you could show your students a glimpse of what you as a enthusiast could accomplish(and what they might customise someday too) it can leave a very lasting positive impression and desire to learn more in their minds.

    • clif@lemmy.worldOP
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      1 year ago

      Excellent suggestions.

      I’ve got one example for the shell scripting section - a script I wrote decades ago called serial_killer.sh that’s used to terminate “bad” processes that spin up tens to hundreds of copies of themselves. You do something like serial_killer.sh my-bad-program and it will use a few CLI commands to find the PIDs for all processes named “my-bad-program”, ask you to input the signal (sigterm/sigkill) to use, ask you for confirmation that you want to send that signal to the list of processes (listing all of them with program name, owner, PID, PPID, etc), then kill all of them in one go if you confirm.

      That was a hacky fix to a bad approach/configuration, but it was a fun script : )

  • Cornelius@lemmy.ml
    link
    fedilink
    arrow-up
    6
    ·
    edit-2
    1 year ago

    I would consider teaching them about a CLI shell, like Fish or ZSH (through oh my zsh), whilst they’re not usually going to have the luxury of a nice shell on a remote server but they will if they’re on a desktop. A good shell makes the CLI soooooo much easier, and faster, to use. Work smarter not harder, install a shell other than bash.

    I would also HIGHLY consider teaching them about desktop app software development on Linux, there’s a surprising number of developers who don’t know about the different ways you can distribute software on Linux:

    • Native system packages
    • Snap packages
    • Flatpaks

    Teaching them about this is definitely a must imho, there are so many OSS projects out there that insist on distributing their software via native system packages (without supporting most distros). They’re also likely to run into it even if they’re just in IT, the server market uses Snaps quite a bit.

      • Cornelius@lemmy.ml
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago

        I highly recommend it, I’ve been using OMZ for almost a year now, it’s super nice and I have no performance issues.

      • theshatterstone54@feddit.uk
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        1 year ago

        A few things you need to know:

        1. In my experience, my super-customised Zsh is a bit slower

        2. It is far more customisable

        3. When loading plugins, do NOT use oh-my-zsh or other plugin managers. In most cases, the plugins are just zsh files, so just source the files directly into your .zshrc to have better performance. For me, zsh with oh my zsh is unbearably slow. Without it, zsh is so much faster.

        4. Add a zsh history file to save your history. This is especially useful if you want to use something like autosuggestions and autocompletion.

        5. Check out my zsh config at https://gitlab.com/theshatterstone/dotfiles for examples of how to do 3 and 4. If you need any help, let me know.

        • Cornelius@lemmy.ml
          link
          fedilink
          arrow-up
          1
          ·
          1 year ago

          When loading plugins, do NOT use oh-my-zsh or other plugin managers. In most cases, the plugins are just zsh files, so just source the files directly into your .zshrc to have better performance. For me, zsh with oh my zsh is unbearably slow. Without it, zsh is so much faster.

          Maybe you used a much older version of oh my ZSH, but at least the latest versions of OMZ I use have no issues with performance at all. It’s a possibility that some of the plugins you’re using just don’t play nice through OMZ in terms of performance. I know there’s been many updates to OMZ as of recent years that have massively improved performance.

          For context the slowest device I use is a laptop (granted with a 5800U), on battery it’ll struggle to load pages quickly, but such is the way of a laptop if you want reasonable battery life. Doesn’t help that the web is a mess though :/

  • qjkxbmwvz@lemmy.sdf.org
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    1 year ago

    Looks awesome! I’d put a big emphasis on piping/IO redirection (maybe move it further up the curriculum?). I find this video, when Kernighan explains some basics, just amazing: https://youtu.be/tc4ROCJYbm0?si=3l48F_Ci9FYDkNEi

    I’d also maybe move shell script basics up a bit — like the really basic stuff. I think it really hammers home the point that the command line and a script are doing the same thing — telling the computer what to do!

  • tla@sopuli.xyz
    link
    fedilink
    arrow-up
    4
    ·
    1 year ago

    +1 for the FOSS philosophy and why that’s important when it comes to privacy (ie closed source crypto implementation back doors etc) + full system control, lack of spyware etc. KVM for the VM demo - keep it Linux, right? Introduce the concept of how almost everything in Linux is a file and can be read from / written to. This is important when understanding pipes. Show pipelines - logical && ie cat x | grep y | grep z. Logical || ie grep -E ‘x|y|z’ Useful commands like top and ps. Explain selinux and why it’s a good idea.

  • chi-chan~@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    1 year ago

    I’m not sure it’s the ‘right’ topic to learn, but I’d want to learn about some of the terms. At least why there are so much ‘Linuxes’, and what is a distro. It doesn’t have to be a full day, but some background is important, IMO.

    • clif@lemmy.worldOP
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      Great point. I think I have a “flavors” note in my margins somewhere but I’ll ensure it makes it into the introduction.