1 Lab 2 “Hello world” in Unix/Linux #include "std_lib_facilities_4.h" int main(){ cout << "Hello, world\n"; return 0; } Task: run “Hello World” program.

Slides:



Advertisements
Similar presentations
Connecting to GMT machine via Windows 7. Windows PuTTy GMT on Mac server int-038.geosci.usyd.edu.au To use GMT, you will connect to a Mac server via PuTTy.
Advertisements

CS1020 Week 3: 29th January 2015.
A Guide to Unix Using Linux Fourth Edition
1 Reading Assignments Linux, g++ & dropboxes Simple C/C++ Program (again) Edit, Compile, Test, Submit CSE Lecture 2 – More Preliminaries.
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.
CIS 240 Introduction to UNIX Instructor: Sue Sampson.
Working Environment - - Linux - -.
Java Programming Working with TextPad. Using TextPad to Work with Java This text editor is designed for working with Java You can download a trial version.
Computer Science 117 Intro to C++ 08/26/13. Today Discuss Syllabus Brief History of C++ How to Execute a C++ program. Reading assignment.
Vi Editor TA for ITIS3100: Xu Fei
UnixUnix Basic. Convention Italic text indicates text displayed by the computer system. For example, login: indicates a login prompt displayed by the.
CS 202 Computer Science II Lab Fall 2009 September 3.
1 Using Editors Editors let you create and edit ASCII files UNIX normally includes two editors: vi and Emacs Vi and Emacs are screen editors: they display.
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
L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G
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.
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
Chapter 3 Mastering Editors
HPC at HCC Jun Wang Outline of Workshop1 Overview of HPC Computing Resources at HCC How to obtain an account at HCC How to login a Linux cluster at HCC.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
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.
VIM  This is the text editor you will use on the workstation.  You can also edit the text files under windows environment and upload it to the workstation.
UNIX Introduction CSCE 221H Texas A&M University.
Getting started: Basics Outline: I.Connecting to cluster: ssh II.Connecting outside UCF firewall: VPN client III.Introduction to Linux IV.Intoduction to.
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.
Tony Kombol.  Why text edit?  Many programs and features require configuration ▪ Configuration is kept in files ▪ Usually in the /etc directory  Changes.
Unix Session IV.
Unix and Samba By: IC Labs (Raj Kidambi). What is Unix?  Unix stands for UNiplexed Information and Computing System. (It was originally spelled "Unics.")
Text Editing February 2 nd, 2004 Class Meeting 3.
Chapter Three Text Editing1 System Programming Text Editing.
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.
Chapter 9 Using Text Editors. vi Editor visual Editor, ASCII text editor, no formatting capabilities almost as powerful as MS Word, has 26 clipboards.
1May 16, 2005 Week 2 Lab Agenda Command Line FTP Commands Review More UNIX commands to learn File name expansion - * Introduction of vi.
Introduction to Unix (CA263) File Editing By Tariq Ibn Aziz.
Isecur1ty training center Presented by : Eng. Mohammad Khreesha.
Java Programming, Second Edition Appendix A Working with Java SDK 1.4.
More on Using onyx 8/28/13. Program 1 Due a week from today. See website for details.
1 Getting Started with C++ Part 2 Linux. 2 Getting Started on Linux Now we will look at Linux. See how to copy files between Windows and Linux Compile.
Dayu Zhang 9/10/2014 Lab03. Outline Brief Review of the 4 Steps in Hello.cpp Example Understand endl and \n Understand Comment Programming Exercise -
 Simple UNIX commands  I/O techniques in C++  Solutions to Lab#0 problems  Solutions to Lab#1 problems 1.
Dr. Sajib Datta Jan 16,  The website is up.  Course lectures will be uploaded there ◦ Check regularly for assignments and update.
BIF703 FTP (File Transfer Protocol) Utility vi editor Utility.
ITX2000 Remote hosts and web servers Prof. Xiaohong (Sharon) Gao Room: T125 Ext: Week 14 – UNIX vi text editor.
Linux CSE 1222 CSE1222: Lecture 1BThe Ohio State University1.
CS:414 introduction to Unix and Linux
GRID COMPUTING.
How to Program.
How to Work on your METEO 473 codes from your PC at home
CS1010: Intro Workshop.
How to Start Programming in Linux Environment
Getting started with CentOS Linux
Guide To UNIX Using Linux Third Edition
Vi Introduction Tony Kombol.
IT244 - Introduction to Linux / Unix Instructor: Bo Sheng
Practice #0: Introduction
Users and Accounts Lab 0.1. Users and Accounts Lab 0.1.
Lab 8 Instructions You can use g++ on build server, visual studio on local machine or your preferred C++ IDE. Important Note: For your grade, please show.
Text Editors Vim (Chapter 6) Emacs (Chapter 7)
The Linux Command Line Chapter 12
Lab 10 Instructions You can use g++ on build server, visual studio on local machine or your preferred C++ IDE. Important Note: For your grade, please show.
CSCE 206 Lab Structured Programming in C
Run Java file with Window cmd
Getting started with CentOS Linux
Chapter 2 Basic vi Editor.
CSCE 206 Lab Structured Programming in C
The Linux Command Line Chapter 12
Presentation transcript:

1 Lab 2 “Hello world” in Unix/Linux #include "std_lib_facilities_4.h" int main(){ cout << "Hello, world\n"; return 0; } Task: run “Hello World” program on Unix/Linux Important note: If you finish the program, Please show me for grading. Then, you can do some exercises in Chapter3 or help others.

2 Step0 Claim your CSE account You need claim your CSE account before LAB if you didn’t do that before: r_Computer_Science_Accounts

3 Step1 Connect to server (for window) 1. Open PuTTY Type “build.tamu.edu” in Host Name and click open. 2. Login with your NetID

4 Step1 Connect to server (for MAC) 1. Open a terminal and type in command: ssh –Y 2. type in your password to login to the server 3. then, you can type ssh –Y build Note: -Y means graphical use

5 Step2 write your “Hello World” 2. Create and open“helloworld.cpp” in vim 3. Press “i” or “a” to enter Insert Mode 4. After entering source code, press “Esc”, exit to Command Mode 5. Type “:wq” to save and quit

6 Step3 add header (for Windows) 1.Map your CSE H: Drive our_CSE_H:_Drive our_CSE_H:_Drive 2. Open your server folder in your local computer 3. Copy “std_lib_facilities_4.h” into the same folder with helloworld.cpp _lib_facilities_4.h

7 Step3 add header (for Mac) 1.Use wget command to download header file on build server Wget Note: make sure the header file is at the same folder with helloworld.cpp

Step3 Compile and run the program The compile command on build is g++ -std=c++14 helloworld.cpp or use command g++ -std=c++14 -Wall -Wextra -pedantic helloworld.cpp for additional syntax checking. Run the program./a.out

Basic vi Commands vi filename edit file i start inserting text ESC stop inserting text ZZ save and exit ENTER go down one line - go up one line dd delete line 0 go to beginning of line SPACE go right one character x delete character