CS 202 Computer Science II Lab - PowerPoint PPT Presentation

About This Presentation
Title:

CS 202 Computer Science II Lab

Description:

emacs/xemacs are text editors used to create/modify files. emacs ... C-x,C-w Save to a new file. C-x,C-c Exit emacs. C-x,u Undo last edit. Text editors VI. ... – PowerPoint PPT presentation

Number of Views:125
Avg rating:3.0/5.0
Slides: 21
Provided by: Nav67
Learn more at: https://www.cse.unr.edu
Category:
Tags: computer | lab | ray | science

less

Transcript and Presenter's Notes

Title: CS 202 Computer Science II Lab


1
CS 202Computer Science II Lab
  • Fall 2009
  • September 3

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

3
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 urwx,gorx file1

4
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

5
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

6
.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

7
..Text editors VI
  • Saving Files
  • w ltfilenamegt save file as ltfilenamegt
  • w save file with current name
  • Exit program
  • wq Save and Exit
  • q! Exit without Save

8
showInfo
  • The content of showInfo.cpp
  • include ltiostreamgt
  • using namespace std
  • int main()
  • cout ltlt "My name is Ray" ltlt endl
  • cout ltlt "My email is amayeh_at_cse.unr.edu" ltlt
    endl
  • return 0

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

10
Compiling Program
  • Primitive Compilation
  • g ltprogramname.cppgt
  • Compile with specified output name
  • g -o ltouput filenamegt ltprogramname.cppgt
  • Compile as object
  • g -c -o ltobject filenamegt ltprogramname.cppgt
  • Linking Program
  • g -o ltobject filenamegt ltpg1.cppgt ltpg2.cppgt

11
Hello World
  • Using any text editor to create file called
    hello.cpp
  • include ltiostreamgt
  • using namespace std //use standard namespace
  • int main()
  • cout ltlt "Hello World" ltlt endl
  • return 0
  • g -o hello hello.cpp
  • ./hello

12
Remote Login
  • Software
  • SSH Secure Shell Client
  • Putty
  • WinSCP
  • Host
  • remote.ecc.unr.edu

13
Remote Login -Putty
14
Remote Login -Putty
15
Remote Login -SSH
16
Remote Login -SSH
17
Remote Login -SSH
18
Remote Login -SSH
19
Remote Login -SSH
20
  • Questions?
Write a Comment
User Comments (0)
About PowerShow.com