1 / 23

Introduction to Linux/Unix

Introduction to Linux/Unix. Working in the CS Environment. 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

Télécharger la présentation

Introduction to Linux/Unix

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Linux/Unix Working in the CS Environment

  2. What is Linux • OS • Open source • Multiple implementations • Based on Unix

  3. Using Linux • Just like Windows (kinda) • GUI elements • Multiple desktops • Command line

  4. 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

  5. Creating Files • Kate • touch • vi • gvim • emacs • Lots of possibilities. Pick *one* to start.

  6. The Command Line • Lots and lots of tools that allow you to… • move around • create and remove • edit • pretty well anything else

  7. 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?

  8. mkdir: Make Directory usage: mkdir [directory name] e.g.: mkdir cmpt111 Note: Naming conventions are important to follow Directories

  9. What’s in a Name? • Case sEnsItive • Reserved characters: *.|>< and more • Spaces are a pain • Numbers are allowed, even at the beginning

  10. 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

  11. 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

  12. 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

  13. 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)

  14. More Cool Stuff ~/ == home ../ == up a level ./ == current level ^C (Control-C) == Emergency Quit exit == quit current shell session

  15. 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

  16. Where should I ssh? In order…. • stealth37 to stealth50 • stealth20 to stealth36 • stealth1 to stealth19 • penguin Names of machines are “stealth”, “morph”, and “penguin”

  17. How Do I Remember This? • man • apropos

  18. One more useful thing… You have disk space! How much…? • quota [username] • df -h • du -hs

  19. 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

  20. ACM Programming Contest • Every year we field teams • Several practice runs • Faculty coach • Even 1st-years can win! • So can YOU! Today!

  21. The C Programming Language • One of the most basic languages • Very fast, very dangerous • Lots of different compilers • (what is a compiler?) • You will be using a subset of the C++ language

  22. HelloWorld.c Try it! • find HelloWorld.c at /www/docs/bootcamp/2007 • use cp to copy it to your home directory • look at it using kate/vi/emacs • Compile as follows: • gcc -o HelloWorld HelloWorld.c • Run it! (./HelloWorld) What does this do?

  23. Assignment • Navigate to /www/docs/bootcamp/2007 • Copy beginner.txt to your own folder space • Open the assignment in a text editor • Start doing it on your own time

More Related