Tutorial Six Recap & Linux Basics CompSci 210 - Semester Two 2016
So what have we done Boolean Algebra Binary Logic circuits Binary Addition Two’s compliment how to write assembly code for the LC-3 What an assembler / Linker is CompSci 210 - Semester Two 2016
Linux CompSci 210 - Semester Two 2016
Connecting to the University Linux Server We use an SSH client to make a network connection to a remote computer (basically text-based remote desktop) Any SSH client should work (hint for mac/linux users) Use SSH to connect to: login.cs.auckland.ac.nz Login using your UPI and password You can access the Linux server from anywhere CompSci 210 - Semester Two 2016
Make an SSH Connection with PuTTY CompSci 210 - Semester Two 2016
You will see this the first time you log in from a new computer CompSci 210 - Semester Two 2016
your connection to the Linux server CompSci 210 - Semester Two 2016
Basic Linux Commands We will not use the Linux command-line very much, but it is important to know a few basic commands ls list files and directories mkdir make directory cd change directory pwd print working directory Source: http://www.ee.surrey.ac.uk/Teaching/Unix/unix1.html
More Basic Linux Commands …and a few additional commands cp copy file mv move file (also used to rename files) rm remove file rmdir remove directory clear clear screen …many more! Feel free to explore. Source: http://www.ee.surrey.ac.uk/Teaching/Unix/unix2.html
Nano Nano is a simple text editor you can use to write code while connected to the Linux server. There is a basic tutorial HERE. You can start Nano by typing the command: nano Or you can edit a specific file by typing it with the command: nano myfile.txt
GCC GCC is the C language compiler we will be using. Only code which compiles using GCC version 4.4.5 (the version found on the Linux server) will be awarded marks for assignment 2. There is a basic tutorial HERE. This command will turn your code into a program called a.out: gcc mycode.c Or you can name your program by typing a name with the command: gcc mycode.c –o myprogram Note: In Linux, compiled programs traditionally have no extension.
cplusplus.com Reference site for C and C++ Provides information on all standard functions Think of it as the LC-3 Reference, but for C. (have it open when you are working) Great place to find example code! Also en.cppreference.com/w/c
Moving files to/from Linux
Moving files to/from Linux