Lecture 01: welcome and intro what LSD and Unix have in common - - PowerPoint PPT Presentation

lecture 01 welcome and intro what lsd and unix have in
SMART_READER_LITE
LIVE PREVIEW

Lecture 01: welcome and intro what LSD and Unix have in common - - PowerPoint PPT Presentation

Lecture 01: welcome and intro what LSD and Unix have in common Hands-On Unix System Administration DeCal 2012-08-27 1 / 21 The connection Two of the most The connection Introduction famous products of Diving into the shell


slide-1
SLIDE 1

1 / 21

Lecture 01: welcome and intro what LSD and Unix have in common

Hands-On Unix System Administration DeCal

2012-08-27

slide-2
SLIDE 2

The connection

❖ The connection Introduction Diving into the shell Text editing 2 / 21

“Two of the most famous products of Berkeley are LSD and

  • Unix. I don’t think that

this is a coincidence.”

(from The Unix-Haters Handbook)

slide-3
SLIDE 3

Introduction

❖ The connection Introduction ❖ What is this? ❖ Who are we? ❖ What is Unix? ❖ What is sysadmining? ❖ Logistics Diving into the shell Text editing 3 / 21

slide-4
SLIDE 4

What is this?

❖ The connection Introduction ❖ What is this? ❖ Who are we? ❖ What is Unix? ❖ What is sysadmining? ❖ Logistics Diving into the shell Text editing 4 / 21

  • CS 98/198-8, the Hands-on Unix

system administration DeCal

  • decal.ocf.berkeley.edu
  • Don’t be shy. Ask questions in class or
  • n Piazza.
slide-5
SLIDE 5

Who are we?

❖ The connection Introduction ❖ What is this? ❖ Who are we? ❖ What is Unix? ❖ What is sysadmining? ❖ Logistics Diving into the shell Text editing 5 / 21

  • Dara Adib: 3rd-year CivE; OCF general

manager, Kloudless DevOps

  • Felix Wong: 4th-year EECS; OCF site

manager, ResComp sysadmin

  • Jessica Yu: 3rd-year CS; ResComp

sysadmin

slide-6
SLIDE 6

What is Unix?

❖ The connection Introduction ❖ What is this? ❖ Who are we? ❖ What is Unix? ❖ What is sysadmining? ❖ Logistics Diving into the shell Text editing 6 / 21

System III & V family

BSD (Berkeley Software Distribution) FreeBSD NetBSD OpenBSD SunOS Solaris NextStep MacOS X Xenix OS GNU Project GNU/Linux Commercial UNIX HP-UX AIX UnixWare IRIX

BSD family

1970 1980 1990 2000

Time

Microsoft/SCO Richard Stallman Darwin GNU/Hurd K16 Linus Torvalds Andrew S. Tanenbaum Minix 7.2 5.0 4.5 10 5/09 5.7 3.3 2.6.30.1 3.1.3a 11i v3 6.1 7.1.4 MP4 6.5.30 4.1.3 Research UNIX 10 Bell Labs: Ken Thompson, Dennis Ritchie, et al. Bill Joy Sun Microsystems AT&T IBM SGI Univel/SCO Apple Computer

https://en.wikipedia.org/wiki/File:Unix_history.svg

slide-7
SLIDE 7

What is sysadmining?

❖ The connection Introduction ❖ What is this? ❖ Who are we? ❖ What is Unix? ❖ What is sysadmining? ❖ Logistics Diving into the shell Text editing 7 / 21

http://xkcd.com/705/

slide-8
SLIDE 8

Logistics

❖ The connection Introduction ❖ What is this? ❖ Who are we? ❖ What is Unix? ❖ What is sysadmining? ❖ Logistics Diving into the shell Text editing 8 / 21

  • lecture-lab format: lab due at start of

next week’s class

✦ lab = homework

  • grading: attendance, labs, final project
  • bring laptop if possible
slide-9
SLIDE 9

Diving into the shell

❖ The connection Introduction Diving into the shell ❖ The shell ❖ In a nutshell ❖ Common shells ❖ Basic programs ❖ Basic programs ❖ Basic programs ❖ Saving keystrokes ❖ RTFM ❖ Unix paradox ❖ ls -l Text editing 9 / 21

slide-10
SLIDE 10

The shell

❖ The connection Introduction Diving into the shell ❖ The shell ❖ In a nutshell ❖ Common shells ❖ Basic programs ❖ Basic programs ❖ Basic programs ❖ Saving keystrokes ❖ RTFM ❖ Unix paradox ❖ ls -l Text editing 10 / 21

  • an ordinary program (e.g., bash) that

lets you access the system

✦ text-based

  • edit files, run other programs, etc.
  • can be automated with shell scripting
slide-11
SLIDE 11

In a nutshell

❖ The connection Introduction Diving into the shell ❖ The shell ❖ In a nutshell ❖ Common shells ❖ Basic programs ❖ Basic programs ❖ Basic programs ❖ Saving keystrokes ❖ RTFM ❖ Unix paradox ❖ ls -l Text editing 11 / 21

  • there’s a prompt
  • type something
  • read output
  • repeat
slide-12
SLIDE 12

Common shells

❖ The connection Introduction Diving into the shell ❖ The shell ❖ In a nutshell ❖ Common shells ❖ Basic programs ❖ Basic programs ❖ Basic programs ❖ Saving keystrokes ❖ RTFM ❖ Unix paradox ❖ ls -l Text editing 12 / 21

  • sh/bash
  • csh/tcsh
  • zsh
  • fish
slide-13
SLIDE 13

Basic programs

❖ The connection Introduction Diving into the shell ❖ The shell ❖ In a nutshell ❖ Common shells ❖ Basic programs ❖ Basic programs ❖ Basic programs ❖ Saving keystrokes ❖ RTFM ❖ Unix paradox ❖ ls -l Text editing 13 / 21

  • pwd: print working directory
  • ls: list file
  • cd: change working directory
  • mkdir: make directory
  • rmdir: remove empty directory
slide-14
SLIDE 14

Basic programs

❖ The connection Introduction Diving into the shell ❖ The shell ❖ In a nutshell ❖ Common shells ❖ Basic programs ❖ Basic programs ❖ Basic programs ❖ Saving keystrokes ❖ RTFM ❖ Unix paradox ❖ ls -l Text editing 14 / 21

  • touch: create/access file
  • mv: move file
  • cp: copy file
  • rm: remove file
slide-15
SLIDE 15

Basic programs

❖ The connection Introduction Diving into the shell ❖ The shell ❖ In a nutshell ❖ Common shells ❖ Basic programs ❖ Basic programs ❖ Basic programs ❖ Saving keystrokes ❖ RTFM ❖ Unix paradox ❖ ls -l Text editing 15 / 21

  • echo: print text
  • cat: print file
  • less (more): scroll (“page”) through

file

  • grep: search file for specified pattern
slide-16
SLIDE 16

Saving keystrokes

❖ The connection Introduction Diving into the shell ❖ The shell ❖ In a nutshell ❖ Common shells ❖ Basic programs ❖ Basic programs ❖ Basic programs ❖ Saving keystrokes ❖ RTFM ❖ Unix paradox ❖ ls -l Text editing 16 / 21

  • command history
  • tab-completion
slide-17
SLIDE 17

RTFM

❖ The connection Introduction Diving into the shell ❖ The shell ❖ In a nutshell ❖ Common shells ❖ Basic programs ❖ Basic programs ❖ Basic programs ❖ Saving keystrokes ❖ RTFM ❖ Unix paradox ❖ ls -l Text editing 17 / 21

  • programs have command line options.

✦ e.g., ls -l

  • programs are (usually) documented

✦ e.g., man ls, ls --help

  • search manpages with apropos (or

Google)

slide-18
SLIDE 18

Unix paradox

❖ The connection Introduction Diving into the shell ❖ The shell ❖ In a nutshell ❖ Common shells ❖ Basic programs ❖ Basic programs ❖ Basic programs ❖ Saving keystrokes ❖ RTFM ❖ Unix paradox ❖ ls -l Text editing 18 / 21

Good Unix programs are

  • simple
  • do one thing well

“cat came back from Berkeley waving flags” (Rob Pike [Unix minimalist])

slide-19
SLIDE 19

ls -l

❖ The connection Introduction Diving into the shell ❖ The shell ❖ In a nutshell ❖ Common shells ❖ Basic programs ❖ Basic programs ❖ Basic programs ❖ Saving keystrokes ❖ RTFM ❖ Unix paradox ❖ ls -l Text editing 19 / 21

  • filenames preceded with a dot are

hidden by default

✦ e.g., .bashrc

  • special directories

✦ . (one dot): current directory ✦ .. (two dots): parent directory

slide-20
SLIDE 20

Text editing

❖ The connection Introduction Diving into the shell Text editing ❖ vi(m) 20 / 21

slide-21
SLIDE 21

vi(m)

❖ The connection Introduction Diving into the shell Text editing ❖ vi(m) 21 / 21

“I was trying to make it usable over a 300 baud modem” (Bill Joy [Berkeley graduate student])

  • modal text editor: normal mode, insert

mode

  • vimtutor