1 of 19

Introduction​​ to​​ UNIX,​ the​​ shell,​ OSS

mdcha

(slides stolen heavily borrowed from mdcha Loren McIntyre)

ocf.io/decal/slides/1

2 of 19

Topics today - 2018-01-30 Tuesday

  • Course logistics
  • Intro to the shell
  • History of UNIX
  • Free and Open Source Software

3 of 19

Logistics

  • 8-9pm in OCF Lab; Tuesdays: Beginner Track
  • Attendance is mandatory (+/- 2). Lecture doubles as office hours / lab time
  • Don’t copy solutions (But feel free to work together!)

4 of 19

Course resources

  • Your facilitators!
  • Join you a Piazza - https://ocf.io/decal/piazza
  • All the material (new and old) is online!
  • Syllabus - will be posting a schedule with links on the home page

5 of 19

Shell

  • What is the shell? A command line-interface (CLI) to interact with the computer.
  • Common shells: bash, zsh, fish
    • They’re mostly the same, (bash will be supported by almost all UNIX systems though).

6 of 19

Shell

  • Level 0 understanding: type things, get results
  • Level 1 understanding: execute programs by name & shell builtin-functions, “shell” collects and shows you results
  • Level 2 understanding: run interactive programs, replacing the shell interface with another program which parses your input

7 of 19

Editors

  • Nano
  • Vim (`vimtutor`)
  • Emacs (Emacs Tutorial)
  • NotePad

8 of 19

9 of 19

Shell Commands

  • Basic structure of a command is `[command] [flags] [arguments]`

  • RTFM! `man command`
  • Google is also your best friend.

10 of 19

Common Shell Commands

  • `cd` - change directory
  • `ls` - list directory
  • `cat` - concatenate and print files
  • `head` - read the first 10 lines
  • `less` - read larger files
  • `mv` - move
  • `cp` - copy
  • `rm` - delete a file

11 of 19

Evolution of UNIX

12 of 19

GNU and the Free Software Movement

“So that I can continue to use computers without violating my principles, I have decided to put together a sufficient body of free software so that I will be able to get along without any software that is not free.”

Richard Stallman (1983)

https://groups.google.com/forum/#!msg/net.unix-wizards/8twfRPM79u0/1xlglzrWrU0J

13 of 19

Meanwhile at Berkeley...

  • A UNIX derivative (BSD) was created at UC Berkeley
  • Popular and reliable, a lot of things from BSD are used today
    • vi and Berkeley sockets
  • Stuck in legal limbo w/ AT&T
  • BSD derivatives still remain popular (MacOS, FreeBSD, OpenBSD)

14 of 19

Unix’s advantages over non-Unix systems

  • UNIX philosophy: simple, short, clear, modular, and extensible code
  • UNIX idea: “everything is a file”
  • Worse is better.
  • Sockets for networking, now copied beyond Unix systems
  • “It’s very simple — you read the protocol and write the code.” - Bill Joy on implementing TCP/IP

15 of 19

Open Source Software (OSS)

Free and Open Source Software (FOSS) or Free/Libre Open Source Software (F/LOSS)

“Free as in beer, and free as in freedom”

Open source software - term used by some software and technology companies. You may not have the right to use, modify, or redistribute the software or source code.

16 of 19

Why FOSS?

  • Security
  • Cost
  • Privacy
  • Control
  • Collaboration

17 of 19

OSS Licenses: Legal Jiggery-Pokery

  • Copyleft (GPL)
    • “I want to make sure that all versions of GNU remain free.” - Stallman (GNU Manifesto)
    • “a cancer that attaches itself in an intellectual property sense to everything it touches” - Steve Ballmer
  • Permissive (MIT, BSD, Apache, WTFPL)
    • Do whatever you want (basically)

18 of 19

Resources

  • ArchWiki
  • TLDP (The Linux Documentation Project, tldp.org) guides: Bash scripting, System Administration
  • The Art of Unix Programming
  • Debian System Administrator’s Handbook
  • Neal Stephenson - “In the Beginning was the Command Line”
  • Over The Wire: Bandit
  • Challenge Problem (Just for fun)
    • Using `curl` (and `man`)...determine how many HTTP redirects it takes to get
      • From http://ocf.io/decal
      • To https://decal.ocf.berkeley.edu

19 of 19

decal.ocf.berkeley.edu/signin

liskov