際際滷

際際滷Share a Scribd company logo
HOW DO I UNIX ?
DEREK GRAHAM
How Do I Unix
How Do I Unix
UNIX
PROJECT GOALS
 performance
 reliability
 multi-user
 security
 admin abilities
 ordinary user abilities
 portable
How Do I Unix
How Do I Unix
TEXT
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
SO FROM NOW ON
LINUX == UNIX
SO WHAT ACTUALLY IS AN OPERATING SYSTEM?
AN OPERATING SYSTEM IS
SO WHAT ACTUALLY IS AN OPERATING SYSTEM?
AN OPERATING SYSTEM IS
 the invisible software that tells the hardware what to do
 understands keyboard and mouse
 draws on the screen
 reads and writes to disk
 reads and write to network
 decides which program runs when
 decides how programs work together
SO WHAT ACTUALLY IS AN OPERATING SYSTEM?
IT ISNT
 anything you can see
 anything you can touch
 a command line
 the windows on your screen
QUIZ TIME
WHICH THINGS ARE UNIX?
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
WHERE IS UNIX
MAJORITY OF WEB SERVERS
 Amazon
 Flickr
 Paypal
 Wikipedia
 Facebook
 Youtube
How Do I Unix
DISTROS
DESKTOP AND LAPTOP UNIX
 Ubuntu
 Fedora
 Debian (& Raspbian)
 Mint
 Elementary
 BSD
TEXT
How Do I Unix
How Do I Unix
How Do I Unix
How Do I Unix
GETTING THINGS DONE
GUIS ARE ALL THE SAME
 Web browser
 Email
 All the normal applications
 Personal preference
GETTING THINGS DONE
WHERE UNIX SHINES
 command line tools
 shell scripting
 compose simple programs together to make complicated
ones
GETTING THINGS DONE
COMMAND LINE PHILOSOPHY
 A program should do one thing and do it well
 A programs output will be the input to another program
 A program should use text streams for input and output
 Text is the universal interface
 Dont clutter output with extra information
GETTING THINGS DONE
GOTCHAS
 case is important
 windows paths use 
 unix paths use /
 why do web addresses use / ?
 commands can be dif鍖cult to remember
 arguments can be worse!
How Do I Unix
GETTING THINGS DONE
MOVING AROUND
 where am i ? - pwd
 change directory - cd
 whats in this directory ? ls
GETTING THINGS DONE
FILES
 print a 鍖le to screen - cat <鍖lename>
 copy 鍖le - cp <from> <to>
 move 鍖le - mv <from> <to>
 鍖nd a 鍖le - 鍖nd . -name *.txt
 search inside 鍖les - grep hello *.txt
 manipulate text - sed
GETTING THINGS DONE
DIRECTORIES
 create a directory - mkdir <directory>
 delete empty directory - rmdir <directory>
 permanently delete !!! - rm <鍖le or directory>
 there is no recycle bin !!!
GETTING THINGS DONE
DOWNLOAD A FILE
 wget http://mywebsite.com/mypicture.jpg
GETTING THINGS DONE
REDIRECTING WITH < > AND I
 chain simple utilities together in interesting ways
 stdin is the command line
 stdout is the screen
 ls . stdin is . stdout is the screen
 ls . > list.txt stdout is now a 鍖le
 ls -l | grep hello stdout goes to input of grep
 very fast - unix handles plumbing between programs
GETTING THINGS DONE
SEARCH FOR FILES
 ls lists 鍖les
 grep searches text and prints results
 sort orders the results
 ls -l | grep hello | sort -r
GETTING THINGS DONE
HOW MANY TIMES DOES A WORD APPEAR IN A FILE?
 wget https://www.gutenberg.org/鍖les/102/102-0.txt
 cat 102-0.txt | grep -c Wilson
GETTING THINGS DONE
WHAT IS THE MOST POPULAR WORD IN A BOOK?
 cat 102-0.txt | (type out the content of the 鍖le )
 tr -cs A-Za-z 'n' | (put each word on a new line)
 tr A-Z a-z | (convert everything to lower case)
 sort | (sort alphabetically)
 uniq -c | (remove duplicates but count how many there were)
 sort -rn (sort in descending order)
 head -n 1 (take the 鍖rst item from the list)
How Do I Unix
GETTING THINGS DONE
SECURITY AND SUDO
 Files are not executable by default
 Unix has a lot of power if you need it
 Users do not have super powers
 You need to be an admin to use super powers
 Super User DO
GETTING THINGS DONE
HELP !!!!!
 Man pages are your friend !
 man ls
 man pwd
 q to quit
PRACTICE
RASPBERRY PI
TEXT
How Do I Unix
How Do I Unix
PRACTICE
QUESTIONS?

More Related Content

How Do I Unix

  • 1. HOW DO I UNIX ? DEREK GRAHAM
  • 4. UNIX PROJECT GOALS performance reliability multi-user security admin abilities ordinary user abilities portable
  • 12. SO FROM NOW ON LINUX == UNIX
  • 13. SO WHAT ACTUALLY IS AN OPERATING SYSTEM? AN OPERATING SYSTEM IS
  • 14. SO WHAT ACTUALLY IS AN OPERATING SYSTEM? AN OPERATING SYSTEM IS the invisible software that tells the hardware what to do understands keyboard and mouse draws on the screen reads and writes to disk reads and write to network decides which program runs when decides how programs work together
  • 15. SO WHAT ACTUALLY IS AN OPERATING SYSTEM? IT ISNT anything you can see anything you can touch a command line the windows on your screen
  • 42. WHERE IS UNIX MAJORITY OF WEB SERVERS Amazon Flickr Paypal Wikipedia Facebook Youtube
  • 44. DISTROS DESKTOP AND LAPTOP UNIX Ubuntu Fedora Debian (& Raspbian) Mint Elementary BSD
  • 45. TEXT
  • 50. GETTING THINGS DONE GUIS ARE ALL THE SAME Web browser Email All the normal applications Personal preference
  • 51. GETTING THINGS DONE WHERE UNIX SHINES command line tools shell scripting compose simple programs together to make complicated ones
  • 52. GETTING THINGS DONE COMMAND LINE PHILOSOPHY A program should do one thing and do it well A programs output will be the input to another program A program should use text streams for input and output Text is the universal interface Dont clutter output with extra information
  • 53. GETTING THINGS DONE GOTCHAS case is important windows paths use unix paths use / why do web addresses use / ? commands can be dif鍖cult to remember arguments can be worse!
  • 55. GETTING THINGS DONE MOVING AROUND where am i ? - pwd change directory - cd whats in this directory ? ls
  • 56. GETTING THINGS DONE FILES print a 鍖le to screen - cat <鍖lename> copy 鍖le - cp <from> <to> move 鍖le - mv <from> <to> 鍖nd a 鍖le - 鍖nd . -name *.txt search inside 鍖les - grep hello *.txt manipulate text - sed
  • 57. GETTING THINGS DONE DIRECTORIES create a directory - mkdir <directory> delete empty directory - rmdir <directory> permanently delete !!! - rm <鍖le or directory> there is no recycle bin !!!
  • 58. GETTING THINGS DONE DOWNLOAD A FILE wget http://mywebsite.com/mypicture.jpg
  • 59. GETTING THINGS DONE REDIRECTING WITH < > AND I chain simple utilities together in interesting ways stdin is the command line stdout is the screen ls . stdin is . stdout is the screen ls . > list.txt stdout is now a 鍖le ls -l | grep hello stdout goes to input of grep very fast - unix handles plumbing between programs
  • 60. GETTING THINGS DONE SEARCH FOR FILES ls lists 鍖les grep searches text and prints results sort orders the results ls -l | grep hello | sort -r
  • 61. GETTING THINGS DONE HOW MANY TIMES DOES A WORD APPEAR IN A FILE? wget https://www.gutenberg.org/鍖les/102/102-0.txt cat 102-0.txt | grep -c Wilson
  • 62. GETTING THINGS DONE WHAT IS THE MOST POPULAR WORD IN A BOOK? cat 102-0.txt | (type out the content of the 鍖le ) tr -cs A-Za-z 'n' | (put each word on a new line) tr A-Z a-z | (convert everything to lower case) sort | (sort alphabetically) uniq -c | (remove duplicates but count how many there were) sort -rn (sort in descending order) head -n 1 (take the 鍖rst item from the list)
  • 64. GETTING THINGS DONE SECURITY AND SUDO Files are not executable by default Unix has a lot of power if you need it Users do not have super powers You need to be an admin to use super powers Super User DO
  • 65. GETTING THINGS DONE HELP !!!!! Man pages are your friend ! man ls man pwd q to quit
  • 67. TEXT