Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers...

Preview:

Citation preview

Lab 1:

Getting Started with the environment

Based on the presentation made by Graham Northup

Objectives

● Be familiar with the Putty and WinScp.● Be familiar with the basic Linux commands.● Understand how to submit assignments for this

course.

Getting a Terminal on Linux

Getting a Terminal on Linux

Getting a Terminal on Linux

Getting a Terminal on Linux

Seeing Stuff on Linux

Making Files on Linux

Moving Around on Linux

Moving Back on Linux

Editing Files

● Linux systems are usually replete with a number of text editors.

● Various users tend to have their own preferences (Google “editor war”)

● You can use nano or vim on Linux and Notepad++, CodeBlocks on Windows. You are free to edit your assignments with whatever you feel comfortable. Make sure you can compile and run it on Polaris!

Starting Vim

Vim

Entering “Insert Mode”

Typing Text

Exiting “Insert Mode”

Exiting Vim

Back to the Terminal

Displaying File Contents

Copying Files

Moving Files

Removing Files

Where you are working

● You should understand the difference between the local machine and the remote server.

● Work saved on these machines is accessible by anyone else who might sit there!

● For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris.

● Connecting to Polaris:

ssh student @ polaris.clarkson.edu

Accessing Servers using Linux Terminal

Your Clarkson username

Full name of the server

Accessing Servers using Linux Terminal

Accessing Servers using Linux Terminal

Where you are

Local host (e.g., ITL machine)

Servers

Network / Internet

Accessing Servers using Linux Terminal

Done on server

Exiting Servers from Linux Terminal

Exiting Servers from Linux Terminal

Done on server

Done on local host

Copying Files from Linux machine to Servers

● scp main.cpp username@polaris.clarkson.edu:/afs/ad.clarkson.edu/class/cs141/students/username/

Your Clarkson username

Server’s full name

Location to copy to

Local file

1. Go to the directory where your file is saved using cd

2. Run this command and enter your password when asked

Accessing Servers in Windows

puttywww.putty.org

Copying Files to Servers in Windows

WinSCPwinscp.net

Task 1

Create three files in your lab directory (/afs/ad.clarkson.edu/class/cs141/username ) on Clarkson (polaris.clarkson.edu):● touch one file;

● Create one file by editing it (e.g., with vim);

● Copy one file with WinScp.

(Filenames nor contents are important.)Deadline: Friday 11:55 pm.