260 likes | 386 Views
Introduction to Linux/Unix. Working in the CS Environment. Using the CS Labs. DO NOT REBOOT MACHINES one tiny little exception (Morphs in S311) Linux machines Commons Stealths S311 Morphs, S320 Penguins, S315 Stealths, S360 Stealths Windows machines Commons Spinks
E N D
Introduction to Linux/Unix Working in the CS Environment
Using the CS Labs • DO NOT REBOOT MACHINES • one tiny little exception (Morphs in S311) • Linux machines • Commons Stealths • S311 Morphs, S320 Penguins, S315 Stealths, S360 Stealths • Windows machines • Commons Spinks • S311 Morphs (These are dual boot) • Macs • S360 (Not yet installed… look for them!)
Lab Access • Available 24-7 • Access always through NE stairwell or the main door on the ground floor • Elevator is restricted to G and 3 between 11 PM and 7 AM
Lab Help • Help Desk -- course-related problems • Merlin/Seth (S307) -- hardware or software issues • iHelp -- for everything, 24-7
Policies • Strict -- no food or drink • Nice -- lidded bottles/cups are unofficially permitted • Use the lounge for eating/drinking and other social activities • Be nice and relatively quiet -- especially in labs
More Polices • No kettles, microwaves, or hotplates • Laptop Polices • If you *must* use power at a non-laptop station, unplug the monitor for the duration of your use. Replace when done! • Wireless is everywhere, but contact ITS for set-up • NEVER unplug a network cable from a computer or the wall • NEVER turn off or unplug a computer
What is Linux • OS • Open source • Multiple implementations • Based on Unix
Using Linux • Just like Windows (kinda) • GUI elements • Multiple desktops • Command line
Philosophy of Linux • Many small programs, not one big program • Matches and exceeds functionality of other OS’s • If it’s not there, add it
Creating Files • Kate
The Command Line • Lots and lots of tools that allow you to… • move around • create and remove • edit • pretty well anything else
ls: List files Usage: ls [options] Common options -l (long format) -R (recursive) -t (sort by time) eg: ls -lt cd: Change Directory Usage: cd [pathname] Common options None eg: cd ~/homework/111 Where am I?
mkdir: Make Directory usage: mkdir [directory name] e.g.: mkdir cmpt111 Note: Naming conventions are important to follow Directories
What’s in a Name? • Case sEnsItive • Reserved characters: *.|>< and more • Spaces are a pain • Numbers are allowed, even at the beginning
mv: Move usage: mv [source] [destination] e.g.: mv myfile.txt cmpt111 mv myfile.txt cmpt111/ mv myfile.txt cmpt111/myfile.txt mv myfile.txt cmpt111/myfiletoo.txt Whoops…. we just changed the name. Moving and Renaming
Copying cp: Copy usage: cp [source] [destination] e.g.: cp myfile.txt cmpt111/ cp myfile.txt cmpt111/myfiletoo.txt cp myfile.txt cmpt111 cp myfile.txt cmpt111/myfile.txt
Removing (Deleting) rm: Remove usage: rm [options] [filename] common options: • -r or -R (recursively) • -f (force) • -d (remove directories) e.g.: rm -r cmpt111 rm -rf cmpt111 rm -d * rm myfile.txt
Wildcards and other cool stuff * Any number of any characters ? A single unknown character e.g.: rm m?file.* Also… • Command completion • Command history • Paste buffer -- highlight and middle click(clipboard)
More Cool Stuff ~/ == home ../ == up a level ./ == current level ^C (Control-C) == Emergency Quit exit == quit current shell session
Remote Log-in ssh -- Secure Shell usage: ssh [options] [username]@[hostname] common options: -l [username] login name -D [port] port e.g.: ssh -l amg918 stealth16.usask.ca ssh amg918@stealth16.usask.ca
Where should I ssh? In order…. • stealth37 to stealth50 • stealth20 to stealth36 • stealth1 to stealth19 • penguin Names of machines are “stealth”, “morph”, and “penguin”
How Do I Remember This? • man • apropos
One more useful thing… You have disk space! How much…? • quota [username] • df -h • du -hs
General Comments • Printing: • Get your pages through PAWS • Three printers: • Spinks360bw1 • Spinks315bw1 • Spinks311bw1 • Don’t print to any printers not labelled bw1, it won’t work • Help is available from Seth/Merlin for printing problems
ACM Programming Contest • Every year we field a few teams • Several practice runs • Faculty coach • Even 1st-years can win!
Assignment • Navigate to /www/docs/bootcamp • Copy beginner.txt to your own folder space • Open the assignment in a text editor • Start doing it…. in the commons.