Skip to content

abeshenov/linux-tutorial

Repository files navigation

GNU/Linux Tutorial

awk? grep? sed? pwd!

In this tutorial we are going to cover some basics of GNU/Linux systems, working from the command line. We'll start with some basic commands, structure of the file system, file permissions, and so on...

There will be three sessions of one hour each.

Here's a command cheat sheet based on our sessions.

Part I

All slides in one .pdf

  1. GNU, Linux, and distributions
  2. First practice
  3. Getting help with man and installing packages with APT
  4. Working with files

Part II

All slides in one .pdf

  1. Users and groups
  2. File permissions
  3. Processes
  4. File system

Part III: Bash scripting

All slides in one .pdf

  1. Wildcards and patterns
  2. Variables
  3. I/O redirection
  4. Scripting basics

For script examples, see scripting/

How to setup a Docker image

You might already have some UNIX-like system at hand, but we want to make sure that everyone has the same environment and doesn't mess with their real system.

So we are going to use Debian GNU/Linux, in particular its latest version Bullseye. We will run the Docker image

debian:bullseye

Here you can check the official Docker images for Debian: https://hub.docker.com/_/debian

Get started

Get Docker working on your system and review some basics of using Docker on https://docs.docker.com/

Below I list docker commands to be executed. All of them require root privileges, so if you're already on Linux, it should be always sudo docker ...

Build a custom image

We want to prepare our own image that has a non-root user (later we'll see what that means).

For this build the image from debian-playground/

It is based on the debian:bullseye image.

First, feel free to replace user in the Dockerfile with your preferred username, and password qwerty with something else.

Here is how you build the image:

cd debian-playground
docker build -t debian-playground .

Check if everything works

Now you should be able to run the new image debian-playground with

docker run -it --hostname cosmos --name debian_container debian-playground

You will see the command line prompt user@cosmos:~$. Instead of cosmos, you may put any hostname you like.

For the moment, just type exit to exit the container.

Going back to the container

When we execute exit, our container gets stopped. To list all containers, do

docker container ls -a

This means that our debian-playground image is in the container named eloquent_brattain, and we are running bash shell in there.

To get back to the same container, we do

docker start -i debian_container

We will continue working in that container, setting up and exploring our Linux system.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published