1 / 10

Lab 00 Discussion Linux Basics

Lab 00 Discussion Linux Basics. CSCE 212 Computer Architecture. Topics Login in SWGN 1D39, a Linux Lab (3D22 is another) Code-all.tgz (all the code from the book) Basic Unix Commands. January 16, 2018. Overview. Last Time Lec00 – C primer slides (we did not go over these in class) New –

cbaer
Download Presentation

Lab 00 Discussion Linux Basics

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. Lab 00 DiscussionLinux Basics CSCE 212 Computer Architecture Topics • Login in SWGN 1D39, a Linux Lab (3D22 is another) • Code-all.tgz (all the code from the book) • Basic Unix Commands January 16, 2018

  2. Overview Last Time • Lec00 – C primer slides (we did not go over these in class) New – • Login • Filesystem “tree” • Basic Commands • Saving attachment from email “code-all.tgz” • Unpacking • Compiling showbytes • Running Next Time:

  3. Login to Unix/Linux Boxes in 1D39 • Your Login name is the root_name of your USC email address • Your password is your email password • To logout you … (I’ll check on this. On my Linux box it is done differently and I’ll have to go down to 1D39 to remember how you do it there.

  4. Unix file system / • At every point in Unix you are “in” the current working directory • At login your “current directory” initially will be your home-dir • You specify files and directories with paths • A full path (starts with slash) /acct/matthews/212 • A relative path does not start with ‘/’ and starts from the current directory acct bin dev … proc etc matthews … ls cp device drivers 212

  5. Basic Commands • ls – list the contents of this directory • cd – change directory • pwd – print working (current) directory • mkdir – make a directory • cp – copy file • mv – move a file (= rename) • rm – remove a file • pico (maybe nano) – a simple editor • gcc (Gnu C Compiler) – • man cmd – print the manual page on cmd

  6. 30 Useful Unix Commands • From Univ. of Manchester 1997 • http://www.maths.manchester.ac.uk/~pjohnson/resources/unixShort/examples-commands.pdf

  7. More Unix references • 50 Most Frequently Used UNIX / Linux Commands (With Examples) • 2010 Ramesh Natarajan • More experienced selection of commands • http://www.thegeekstuff.com/2010/11/50-linux-commands/?utm_source=feedburner • 100 Useful Unix Commands & Unix Intro. • 2014 by Oliver • http://www.oliverelliott.org/article/computing/ref_unix/ • http://www.oliverelliott.org/article/computing/tut_unix/

  8. Saving and unpacking code-all.tgz • mkdir 212 • Student webmail • Save attachment • cd // go home • cd Downloads • cp code-all.tgz ~/212 • cd ~/212 • ls • tar xvfz code-all.tgz

  9. Compiling showbytes • Cd code • Cd data • gccshow_bytes.c // this produces a.out • ./a.out // run the executable • gccshow_bytes.c –o prog// names the executable prog • ./prog // run the executable • Note show_bytes.c might be show-bytes.c

More Related