Download presentation
Presentation is loading. Please wait.
Published byCaitlin Walsh Modified over 7 years ago
1
Tutorial Six Linux Basics CompSci Semester Two 2016
2
Agenda C on Windows C on Linux <<<<< must know
Visual Studio C on Linux <<<<< must know Linux Server My favorite IDE Clion (Mac and Windows) Hello world demonstration CompSci Semester Two 2016
3
Personal C Environment
Programming with IDE Visual studio - for windows Student free Clion – my favorite on Mac A student can get a 1-year free license from its website Eclipse/CodeBlocks CompSci Semester Two 2016
4
Linux C Environment Editor: Nano/Vim/Emacs Sublime text/Notepad++
Compiler: Gcc - unix Clang – Mac os Debug: GDB (advanced) CompSci Semester Two 2016
5
Linux CompSci Semester Two 2016
6
operating systems family
UNIX Family Commercial Unix BSD Mac OS Linux MS-DOS Windows CompSci Semester Two 2016
7
Practice on linux Login on Linux Commands on Linux
Programming on Linux CompSci Semester Two 2016
8
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 Semester Two 2016
9
Make an SSH Connection with PuTTY
CompSci Semester Two 2016
10
You will see this the first time you log in from a new computer
CompSci Semester Two 2016
11
your connection to the Linux server
CompSci Semester Two 2016
12
Connection From mac CompSci Semester Two 2016
13
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:
14
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:
15
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
16
GCC GCC is the C language compiler we will be using. Only code which compiles using GCC version (the version found on the Linux server) will be awarded marks for assignment 2. There is a basic tutorial HERE or 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.
17
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
18
Moving files to/from Linux
=> EC AFS
19
Moving files to/from Linux
=> unixhome
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.