Operating Systems - Unix
Lectures, Labs, Exercices and Graded projects
Crédits ECTS : 3
Elie Annestay
Grading system :
Two components :
1. The lab progression
The more you progress through it the more you will familiarize yourselves with
using a computer terminal.
2. The shell scripting project
Scripting is so important for automating and simplifying tasks especially when
running a programming environment, this will ensure you’ve at least ran a few of
your own scripts and looked through the errors you got while doing it.
What is Unix
A bit of history about
Unix out of order
Magic VLSI :
VLSI & Beyond Open source
software for
Chip design
Standard cell
A “real” transistor
Matt Venn, www.zerotoasiccourse.com
Some numbers
Von Neumann Architecture
Von Neumann Architecture
A gif of the inner workings of a simulated “computer”
https://www.techtarget.com/whatis/definition/round-robin
Unix initially lacked multi-tasking and portability support
Later developments added:
●
Multi-tasking capabilities
●
Multi-user capabilities in time-sharing configuration
●
Portability features
Key Unix concepts include:
●
Plain text data storage
●
Hierarchical file system
●
Treatment of devices and IPC as files
●
Use of many small software tools connected via
command-line interpreter and pipes
●
Contrast with monolithic program approach
What is a shell
A Unix shell is a command-line interpreter that provides a user interface to interact
with the operating system's services and utilities through text-based commands.
The computer terminal
IBM 2741 - 1960-1970 VT100 - 1978
or Bell labs
Creation of Unix at bell labs in 1969 by Ken
Thompson and Dennis Ritchie
1969-72 UNIX operating system and C programming language: Makes large-scale
networking of varied operating systems, and thus the Internet, practical.
1978 - First Berkeley Software Distribution (1BSD) released by Bill Joy
1984 - AT&T UNIX System V released
1987 - MINIX released by Andrew Tanenbaum
1991 - Linux kernel first released by Linus Torvalds
Other unix distro released in open source from 1993
2000 - Apple releases Darwin, the open-source foundation of macOS
Linux distributions (aka distros)
Some more of the history in another session
How to get started with BASH (Bourne Again SHell)
Option 1 : Mac or linux Option 2 : Windows VM Option 3 : Windows WSL
https://ubuntu.com/tutorials/h Warning ! This option will require
just open the terminal ow-to-run-ubuntu-desktop-on- you to restart your computer.
and do echo $SHELL a-virtual-machine-using-virtual https://learn.microsoft.com/en-us
box#1-overview /windows/wsl/install
you should see
once installed open the once installed open the terminal
something like this : terminal and do echo and do echo $SHELL
/bin/bash $SHELL you should see something like
you should see something this :
/bin/bash
like this :
/bin/bash
Window Subsystem for Linux
Pros: Cons:
● Run Linux tools directly on ● Can be slower than real Linux
Windows ● Not all Linux programs work
● Easy to set up and use perfectly
● Works well with coding tools like ● File sharing between Windows
VSCode and Linux can be tricky
● Uses less resources than a virtual ● Needs Windows 10 or newer
machine ● Can be confusing for beginners
● Good for developers who need
both Windows and Linux
WSL2 + Powershell and GUIs as backup
Use the tool that works not the one someone tells you to use.
My environnement
debian on wls2 windows with anaconda prompt
CLI
command [options] [arguments]
command [flag] [arguments]
ls [-l] []
ls [-l] [/mnt/c/Users/eliea]
ls [] [.] = ls
Basic bash commands
ls
cd path_to_target_folder
rm -r /path_to_my_unwanted_folder
pwd
mkdir path_for_my_directory/directory_name
Basic powershell commands
dir
cd path_to_target_folder
del -r /path_to_my_unwanted_folder
echo %cd%
mkdir
path_for_my_directory/directory_name
Sequencing
command [opt] [arg]; command_2 [opt] [arg]
pwd ; ls
date ; uptime
cd myproject && ls
cd temp || mkdir temp
date > timestamp.txt
ls -l | awk ‘{print $9}’
Challenge 1 :
title:Man Page Master
description: Use the 'man' command to find out what option
in the 'ls' command shows hidden files.
note: Use the man command to explore the ls command options
Challenge 2 :
title: File Finder
description: Use 'ls' with appropriate options to list all
files (including hidden) in the current directory, showing
file sizes in human-readable format.
note: Use the man command to explore the command options
Challenge 3 :
title: Path Puzzle
description: Starting from /etc/user, navigate to /etc/apt,
and finally back to /home/user. Print your location after
each move.
note: Use the man command to explore the command options
Challenge 4 :
title: Help Hero
description: Use the --help option with the 'grep' command
to find out what option is used for case-insensitive
searching.
note: Use the man command to explore the command options
Bonus :
Explain what this command does: ls -ltr /home/user