CS 202 Computer Science II Lab Fall 2009 September 3.

Slides:



Advertisements
Similar presentations
In the last Session… ls -l command seven fields nine permissions of a file ls -ld file ownership file permissions (three-tiered file protection system)
Advertisements

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.
Linux Workshop Session 1 Khadka, Santosh and Panthi, Sanjeeb Computer Science Department Lamar Univers Lamar Univers ity.
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 - -.
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 August 27.
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.
Dayu Zhang 9/3/2014 Lab01. Lab Instructor: Dayu Zhang Office Hour Mon/Wed 10:40am – 11:10am Room A201 Lab Website
Lecture 02CS311 – Operating Systems 1 1 CS311 – Lecture 02 Outline UNIX/Linux features – Redirection – pipes – Terminating a command – Running program.
Starting Vi Opening an existing file vi filename Creating a new file vi filename In your workshop directory, create a new file called mysong vi mysong.
CS 117 Section 2 + KNET Computer accounts – ed to KNET students –Change password Homework 1 Lab Tutors –In lab for next 2 weeks –Will help you with.
CSCI 330 T HE UNIX S YSTEM Editing files. E DITOR C ONCEPTS Editing a file is to modify the content of a file Text editor: Enter and modify text in a.
Using Linux Text Editors. Use Non-Graphical Linux Text Editors Graphical Text Editor.
1 Unix Editors (ee, ed, ex, vi, vim) and Compilers (g77, gcc) Speaker: Li-Wen Chen Date:
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.
Cmsc 312 Operating Systems. UNIX? DOS – PC? VAX/VMS - mainframe Unix – PC, workstation, mainframe 1970 bell Lab For computer scientist? Why popular? Free.
CS161 Topic #21 CS161 Introduction to Computer Science Topic #2.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
The UNIX development environment CS 400/600 – Data Structures.
LINUX Tuesday, 5 July :00 pm. Remote Login l Use Secure Shell (ssh) l Machine name/IP address E.g. ssh hydra.sma.nus.edu.sg Or ssh
1 Editing a C Program 01/16/15. 2 Objective Use Linux to edit, compile and execute a C program.
Intro. To Unix commands For those who’ve never used Unix before Quick tutorial to let you move around your Unix Accounts No discussion of inner workings.
1 Lab 2 “Hello world” in Unix/Linux #include "std_lib_facilities_4.h" int main(){ cout
UNIX Introduction CSCE 221H Texas A&M University.
Text editors Why should I use an editor ? It is very important to able to use at least one text mode editor a text mode editor is so useful on remote machines.
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.
Text Editing February 2 nd, 2004 Class Meeting 3.
Chapter Three Text Editing1 System Programming Text Editing.
VI EDITOR University of Mississippi. Vi Editor What is Vi ? ▫Vi is a screen based editor. ▫The screen of your terminal will act as a window into the file.
Chapter 9 Using Text Editors. vi Editor visual Editor, ASCII text editor, no formatting capabilities almost as powerful as MS Word, has 26 clipboards.
Introduction to Unix (CA263) File Editing By Tariq Ibn Aziz.
Lesson 4-Mastering the Visual Editor. Overview Introducing the visual editor. Working in an existing file with vi. Understanding the visual editor. Navigating.
Chapter Three The UNIX Editors.
Isecur1ty training center Presented by : Eng. Mohammad Khreesha.
Text editing and more basic commands CS 2204 Class meeting 3 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
Vi editor Pronounced: `vee eye‘’. Agenda Describe the background of vi Editor Use vi editor to: create text files edit text files Our Goal is to create.
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.
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.
THE C PROGRAMMING ENVIRONMENT. Four parts of C environment  Main menu  Editor status line and edit window  Compiler message window  “Hot Keys” quick.
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.
Shell Script Reference: Linux Shell Scripting Tutorial v1.05r3 A Beginner's handbook
Getting Started with Linux Linux System Administration Editors.
Linux CSE 1222 CSE1222: Lecture 1BThe Ohio State University1.
CS:414 introduction to Unix and Linux
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.
CS1010: Intro Workshop.
Vi Editor.
Vi Introduction Tony Kombol.
Lecture 3 More on editors: emacs and vi COP 3344 Introduction to UNIX.
IT244 - Introduction to Linux / Unix Instructor: Bo Sheng
Linux System Administration Editors
Text Editors Vim (Chapter 6) Emacs (Chapter 7)
Web Programming Essentials:
Emacs CSC 135.
Run Java file with Window cmd
Chapter 2 Basic vi Editor.
Lab 7 Shell Script Reference:
CSCI The UNIX System Editing files
Day 5 Emacs Editor David A. Gaitros Department of Computer Science
Presentation transcript:

CS 202 Computer Science II Lab Fall 2009 September 3

Today Topics File Access Permissions Text Editors – VI – Emacs Compiling C++ Programs Accessing Linux Remotely – Putty – SSH

File Access Permissions user u/group g/other o r or 4 read permission w or 2 write permission x or 1 execute permission - no permission chmod [options] file –change file or directory access permissions; (+/-/=) – chmod 755 file1 or chmod u=rwx,go=rx file1

Text editors - emacs emacs/xemacs – are text editors used to create/modify files emacs [filename] – $ emacs cs202file.cpp Note: – C- = Control (Ctrl) key – M- = Meta key, generally the Alt key but can also be the Esc key Essential Commands – C-x,C-s Save the file – C-x,C-w Save to a new file – C-x,C-c Exit emacs – C-x,u Undo last edit

Text editors – VI.. There are two mode on this editor: – Command mode – Text-entry mode vi [filename] Back to command mode by using “Esc” key

.Text editors – VI. Inserting text: – ‘i’ : insert before cursor – ‘a’ : append after cursor – ‘R’ : replace the text – ‘I’, ‘A’, ‘o’, ‘O’ Deleting text: – ‘x’ : delete character under cursor – ‘dw’ : delete word under cursor – ‘dd’ : delete line under cursor

..Text editors – VI Saving Files – ‘:w ’ : save file as – ‘:w’ : save file with current name Exit program: – ‘:wq’ : Save and Exit – ‘:q!’ : Exit without Save

showInfo The content of “showInfo.cpp” #include using namespace std; int main() { cout << "My name is : Ray" << endl; cout << "My is : << endl; return 0; }

Compiling and Running C++ programs on Linux The g++ compiler: On Linux and many Unix systems the standard C++ compiler is called g++.

Compiling Program Primitive Compilation – $ g++ Compile with specified output name – $ g++ -o Compile as object – $ g++ -c -o Linking Program – $ g++ -o

Hello World Using any text editor to create file called “hello.cpp” #include using namespace std; //use standard namespace int main() { cout << "Hello World" << endl; return 0; } g++ -o hello hello.cpp./hello

Remote Login Software: – SSH Secure Shell Client – Putty – WinSCP Host: – remote.ecc.unr.edu

Remote Login -Putty

Remote Login -SSH

Questions?