CS1010: Intro Workshop.

Slides:



Advertisements
Similar presentations
Introduction to the Omega Server CSE Overview Intro to Omega Basic Unix Command Files Directories Printing C and C++ compilers GNU Debugger.
Advertisements

Cosc 4750 Getting Started in UNIX Don’t be afraid of the prompt, in linux it can be your best friend. In some cases, the only way to do certain things.
Dayu Zhang 9/8/2014 Lab02. Example of Commands pwd --- show your current directory This is home of venus, not your home directory Tilde: means you are.
CSCI 1411 FUNDAMENTALS OF COMPUTING LAB Lab Introduction 1 Shane Transue MSCS.
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
CS1020: Intro Workshop. Topics CS1020Intro Workshop Login to UNIX operating system 2. …………………………………… 3. …………………………………… 4. …………………………………… 5. ……………………………………
Dayu Zhang 9/3/2014 Lab01. Lab Instructor: Dayu Zhang Office Hour Mon/Wed 10:40am – 11:10am Room A201 Lab Website
Unix Workshop Aug What is Unix Multitasking, multiuser operating system Often the OS of choice for large servers, large clusters.
A crash course in njit’s Afs
L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G
UNIT 1 Computing Fundamentals.
Help session: Unix basics Keith 9/9/2011. Login in Unix lab  User name: ug0xx Password: ece321 (initial)  The password will not be displayed on the.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction Unix-like system is everywhere Linux Android for smartphones Google Chrome OS for Chromebook Web.
Computer Programming for Biologists Oct 30 th – Dec 11 th, 2014 Karsten Hokamp  Fill out.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
The UNIX development environment CS 400/600 – Data Structures.
1 N305 C Programming. 2 Objectives for the Lab ä Learn problem solving strategies ä Achieve intermediate knowledge of C Programming Language ä Gain experience.
Vim Editor and Unix Command gcc compiler Computer Networks.
1 Editing a C Program 01/16/15. 2 Objective Use Linux to edit, compile and execute a C program.
PROGRAMMING PROJECT POLICIES AND UNIX INTRO Sal LaMarca CSCI 1302, Fall 2009.
1 Lab 2 “Hello world” in Unix/Linux #include "std_lib_facilities_4.h" int main(){ cout
ENEE150 – 0202 ANDREW GOFFIN Introduction to ENEE150.
Getting started: Basics Outline: I.Connecting to cluster: ssh II.Connecting outside UCF firewall: VPN client III.Introduction to Linux IV.Intoduction to.
Next Unix Topics Tuesday, 2/11 & 18/2014. Change Password (by 2/14/14) ssh to account on – faclinux.cse.ohio-state.edu – stdlinux.cse.ohio-state.edu passwd.
Introduction to UNIX Road Map: 1. UNIX Structure 2. Components of UNIX 3. Process Structure 4. Shell & Utility Programs 5. Using Files & Directories 6.
Compiling a C Program. Before we can begin we must open a telnet session to phobos. There are a number of ways to do this, but the easiest is to click.
CGS 3460 Why we choose UNIX n Powerful lMulti-user operating system lGood programming tools Most heavy-duty database management systems started out on.
Basic Unix Commands CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang.
Unix and Samba By: IC Labs (Raj Kidambi). What is Unix?  Unix stands for UNiplexed Information and Computing System. (It was originally spelled "Unics.")
Creating Programs on UNIX This term you can create programs on UNIX or you can create programs using a C++ compiler on your PC. This set of slides steps.
1May 16, 2005 Week 2 Lab Agenda Command Line FTP Commands Review More UNIX commands to learn File name expansion - * Introduction of vi.
PostgreSQL Installation By: Keerthi Nelaturu Previous version by Ahmed Jeddah & Miguel Garzon.
More on Using onyx 8/28/13. Program 1 Due a week from today. See website for details.
Unix Servers Used in This Class  Two Unix servers set up in CS department will be used for some programming projects  Machine name: eustis.eecs.ucf.edu.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
Introduction to UNIX and Linux.  Written by Dennis Ritchie and Ken Thomsom at Bell Labs in 1969  Initially written in assembly language and a high-level.
CS 120 Extra: The CS1 Server Tarik Booker CS 120.
Linux CSE 1222 CSE1222: Lecture 1BThe Ohio State University1.
1 N305 C Programming. 2 Objectives for the Lab ä Learn problem solving strategies ä Achieve intermediate knowledge of C Programming Language ä Gain experience.
UNIX Basics Matt Hayward October 18, 2016 LS560 – Information Technology for information professionals.
Tutorial Six Linux Basics CompSci Semester Two 2016.
GRID COMPUTING.
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
SEEM3460 Tutorial Unix Introduction.
First Day in Lab Making a C++ program
Getting started with CentOS Linux
Tutorial Six Recap & Linux Basics CompSci Semester Two 2016.
Web Programming Essentials:
CS1010 Programming Methodology
UNIX The Basics Source:
Andy Wang Object Oriented Programming in C++ COP 3330
The Command Prompt Commands are the way to “do things” in Unix
Part 3 – Remote Connection, File Transfer, Remote Environments
Welcome to CSCI 230! Problem Solving using C
Assignment Preliminaries
Unix Systems Administration
Creating Programs on UNIX
Tutorial of Unix Command & shell scriptS 5027
Tutorial of Unix Command & shell scriptS 5027
Intro to UNIX System and Homework 1
Welcome to CSCI 230! Problem Solving using C
CSCE 206 Lab Structured Programming in C
Web Programming Essentials:
Tutorial of Unix Command & shell scriptS 5027
Introduction Paul Flynn
Getting started with CentOS Linux
CGS 3175: Internet Applications Fall 2009
Andy Wang Object Oriented Programming in C++ COP 3330
CSCE 206 Lab Structured Programming in C
Presentation transcript:

CS1010: Intro Workshop

Topics Login to UNIX operating system …………………………………… CS1010 Programming Methodology Intro Workshop - 2

Sunfire UNIX server CS1010 Programming Methodology Intro Workshop - 3

Logging into UNIX System (1/3) To login to sunfire server, you need your SoC UNIX account user-name and password. If you don’t have it yet, create your account here: https://mysoc.nus.edu.sg/~newacct We will start at _______ In the meantime, please read the document “Getting Started with UNIX and CodeCrunch” on this CS1010 web page: http://www.comp.nus.edu.sg/~cs1010/3_ca/labs.html For students who forgot their UNIX password, they can go to https://mysoc.nus.edu.sg/~myacct/iforgot.cgi to reset their password. CS1010 Programming Methodology Intro Workshop - 4

Logging into UNIX System (2/3) 1. Look for the SSH Secure Shell Client icon on your desktop, and double click on it. Click on “Quick Connect” to get the pop-up window. Enter “sunfire” for Host Name if connecting within campus or “sunfire.comp.nus.edu.sg” if connecting from off campus Enter your UNIX id as User Name. CS1010 Programming Methodology Intro Workshop - 5

Logging into UNIX System (3/3) 3. Enter your UNIX password. 4. Once you log in successfully into your UNIX account, you will see this screen (actual display may vary). CS1010 Programming Methodology Intro Workshop - 6

Topics Login to UNIX operating system Setup your Sunfire account …………………………………… CS1010 Programming Methodology Intro Workshop - 7

Set up Your Sunfire Account (1/3) Now you are successfully connected to sunfire. What happened indeed? CS1010 Programming Methodology Intro Workshop - 8

Set up Your Sunfire Account (2/3) Every SoC student has an account on sunfire. You can do many interesting things with your sunfire account. e.g., I treat my sunfire account as a thumb drive! CS1010 Programming Methodology Intro Workshop - 9

Set up Your Sunfire Account (3/3) If this is your first time logging in Type the following two commands one by one to configure your account for programming: ~cs1010/workshop/setup (enter y when prompted) source .bash_profile (no response from the system is good news!) CS1010 Programming Methodology Intro Workshop - 10

Topics Login to UNIX operating system Setup your Sunfire account Basic UNIX commands …………………………………… CS1010 Programming Methodology Intro Workshop - 11

Basic UNIX commands (1/5) Tree structure CS1010 Programming Methodology Intro Workshop - 12

Basic UNIX commands (2/5) In a UNIX shell (like sunfire), you need a lot of typing but much less mouse clicking, compared with Windows operating system which you might be more familiar with. There are a few useful commands that you need to remember which will facilitate your navigation in the UNIX world. Practice is the best way to recognize UNIX commands. Gradually you will be more and more familiar with UNIX commands – so don’t worry too much at the beginning. CS1010 Programming Methodology Intro Workshop - 13

Basic UNIX commands (3/5) ls command (means list directory contents) will enable you to see all the files and subfolders in current folder. There are a few more complex usage of ls, but first of all, be familiar with the simplest one – just “ls”. CS1010 Programming Methodology Intro Workshop - 14

Basic UNIX commands (4/5) mkdir (means make directory) will create a sub-directory. rmdir (means remove directory) will delete an empty directory. make a new directory the new directory just created CS1010 Programming Methodology Intro Workshop - 15

Basic UNIX commands (5/5) cd command allows you to enter a designated directory. cd workshop will bring you to workshop directory cd .. will bring you back to the parent directory (note space between cd and ..) Enter this directory CS1010 Programming Methodology Intro Workshop - 16

Topics Login to UNIX operating system Setup your Sunfire account Basic UNIX commands Coding: Edit – Compile – Run …………………………………… CS1010 Programming Methodology Intro Workshop - 17

Programs: Edit, Compile and Execute produces Source code welcome.c Editor eg: vim welcome.c produces Executable code a.out Compiler eg: gcc welcome.c Execution eg: a.out produces Hello, welcome to CS1010! Sample output CS1010 Programming Methodology Intro Workshop - 18

Write a C Program using vim Vim is a powerful text editor Command Mode is used to issue vim commands. Insert Mode is used to type in text. Switch back and forth between two modes: i <Esc> CS1010 Programming Methodology Intro Workshop - 19

Write a C Program using vim Now use vim to type in the follow program: vim hello_world.c // this program prints out "Hello World!" on the screen #include <stdio.h> int main(void) { printf("Hello World!\n"); return 0; } When finished: Switch back to command mode Save and quit vim by pressing key combination :wq Hint: different color implies different meaning… If you get a wrong color, it means something is wrong! CS1010 Programming Methodology Intro Workshop - 20

Compile a Program with gcc gcc is a compiler to translate your C source code into machine code. gcc –Wall hello_world.c gcc may report compilation (syntax) error to you if any. Correct your program till it is free of syntax errors. If there is no error, an output file a.out will be created on the harddisk - ls to look for it. Run the executable version of your program: a.out CS1010 Programming Methodology Intro Workshop - 21

File Processing cp command makes a copy of a file. mv command moves a file to another folder. mv command is also used to rename a file. rm command deletes a file. Check the lab document or consult your DL for details http://www.comp.nus.edu.sg/~cs1010/labs/2013/intro_lab/gettingStarted.html#section3 CS1010 Programming Methodology Intro Workshop - 22

Topics Login to UNIX operating system Setup your Sunfire account Basic UNIX commands Coding: Edit – Compile – Run File transfer between your Sunfire account and your own computer/laptop CS1010 Programming Methodology Intro Workshop - 23

File Transfer from/to Sunfire CS1010 Programming Methodology Intro Workshop - 24

Open a C Program in Windows CS1010 Programming Methodology Intro Workshop - 25

Congratulations! You have cleared this UNIX workshop (no certificate will be issued though…) You will gain more experience after days and weeks. Now you may want to disconnect from sunfire. The command is quite simple: exit or logout Try it and say “bye-bye”! CS1010 Programming Methodology Intro Workshop - 26

End of File