34
Lab 1: Getting Started with the environment Based on the presentation made by Graham Northup

Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Lab 1:

Getting Started with the environment

Based on the presentation made by Graham Northup

Page 2: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Objectives

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

course.

Page 3: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Getting a Terminal on Linux

Page 4: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Getting a Terminal on Linux

Page 5: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Getting a Terminal on Linux

Page 6: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Getting a Terminal on Linux

Page 7: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Seeing Stuff on Linux

Page 8: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Making Files on Linux

Page 9: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Moving Around on Linux

Page 10: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Moving Back on Linux

Page 11: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

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!

Page 12: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Starting Vim

Page 13: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Vim

Page 14: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Entering “Insert Mode”

Page 15: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Typing Text

Page 16: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Exiting “Insert Mode”

Page 17: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Exiting Vim

Page 18: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Back to the Terminal

Page 19: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Displaying File Contents

Page 20: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Copying Files

Page 21: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Moving Files

Page 22: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Removing Files

Page 23: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

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.

Page 24: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

● Connecting to Polaris:

ssh student @ polaris.clarkson.edu

Accessing Servers using Linux Terminal

Your Clarkson username

Full name of the server

Page 25: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Accessing Servers using Linux Terminal

Page 26: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Accessing Servers using Linux Terminal

Page 27: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Where you are

Local host (e.g., ITL machine)

Servers

Network / Internet

Page 28: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Accessing Servers using Linux Terminal

Done on server

Page 29: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Exiting Servers from Linux Terminal

Page 30: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Exiting Servers from Linux Terminal

Done on server

Done on local host

Page 31: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Copying Files from Linux machine to Servers

● scp main.cpp [email protected]:/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

Page 32: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Accessing Servers in Windows

puttywww.putty.org

Page 33: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

Copying Files to Servers in Windows

WinSCPwinscp.net

Page 34: Lab 1: Getting Started with the environment...For assignments, the University has dedicated servers which also provide a Linux environment, one of which is Polaris. Conn

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.