The UNIX development environment CS 400/600 – Data Structures.

Slides:



Advertisements
Similar presentations
CS1020 Week 3: 29th January 2015.
Advertisements

1 Introduction to UNIX Ke Liu
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.
Program Development Tools IDE vs point tools Two tool flavors exist for developing embedded software: -IDEs: (Integrated Development Environments) i.e.,
Chapter 5 Editing Text Files
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.
Guide To UNIX Using Linux Third Edition
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.
A Mini UNIX Tutorial. What’s UNIX?  An operating system run on many servers/workstations  Invented by AT&T Bell Labs in late 60’s  Currently there.
L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
Learning basic Unix command IT 325 operating system.
Brief introduction to UNIX A. Emerson CINECA, High Performance Systems.
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.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
1 Lecture 2 Working with Files and Directories COP 3344 Introduction to UNIX.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
T HE VI EDITOR. vi has 2 modes: command mode (initial or "default" mode) insert mode [Esc] is used to switch to command mode. In general, vi commands:
리눅스 : Lecture 5 UNIX 유틸리티 : text editor, compilation (make), …
Working with Linux Lab 1 1. Login and logout Account – username & password – Note: Linux is case-sensitive Administrator: username = root Logout: exit,
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.
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.
L&T Infotech1 UNIX – Getting Started - Aneesh Ramani.
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.
Basic Unix Commands CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang.
Text Editing February 2 nd, 2004 Class Meeting 3.
Chapter Three Text Editing1 System Programming Text Editing.
Unix Environment Input Output 2  List Content (ls) ◦ ls (list current directory) ◦ ls –all (include hidden files/folders)  Make directory (mkdir) ◦
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.
1May 16, 2005 Week 2 Lab Agenda Command Line FTP Commands Review More UNIX commands to learn File name expansion - * Introduction of vi.
Lesson 4-Mastering the Visual Editor. Overview Introducing the visual editor. Working in an existing file with vi. Understanding the visual editor. Navigating.
Week 8: Linux / ubuntu Dr. I. H. Shah. / CSCS 301 Fall 2009.
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
Agenda Using vi Editor Starting vi Session Command / Input Modes Entering Text Editing Text Saving Edited File Aborting Editing Session.
Agenda Using vi Editor Starting vi Session Command / Input Modes
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
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.
Basic Unix Commands. Listing files and directories ● ls:command is used to list the files and ● directories in present working directory ● ls command.
ICE UNIX TUTORIAL. File System Commands cd – change directory cd – change directory ls – list contents ls – list contents rm – remove/delete rm – remove/delete.
Learning basic Unix command It 325 operating system.
 Simple UNIX commands  I/O techniques in C++  Solutions to Lab#0 problems  Solutions to Lab#1 problems 1.
File Management commands cat Cat command cat cal.txt cat command displays the contents of a file here cal.txt on screen (or standard out).
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.
Quality Thought Technologies
Getting started with CentOS Linux
Commands Basic syntax of shell commands UNIX or shell commands have a basic structure command -options target command comes first (such as cd or ls) any.
Lecture 2 Working with Files and Directories
Some Linux Commands.
The Command Prompt Commands are the way to “do things” in Unix
Eric Shook Department of Geography Kent State University
Vi Editor.
Vim.
Tutorial of Unix Command & shell scriptS 5027
Tutorial of Unix Command & shell scriptS 5027
Web Programming Essentials:
Tutorial of Unix Command & shell scriptS 5027
Getting started with CentOS Linux
Chapter 2 Basic vi Editor.
Module 6 Working with Files and Directories
January 26th, 2004 Class Meeting 2
Presentation transcript:

The UNIX development environment CS 400/600 – Data Structures

ADTs and SimpleList2 Basic UNIX commands  The directory tree pwd – Print working directory ls – List contents cd – change directory  Relative path: dir/dir/dir  Absolute path : /dir/dir/dir Special directory names: . = current directory .. = parent directory  ~ = my home directory  ~fred = fred’s home directory

ADTs and SimpleList3 Working with files  More directory commands mkdir – make directory rmdir – remove directory (must be empty)  File commands cp – copy a file mv – move or rename touch – create a file or update the timestamp rm – remove a file  rm -r – remove an entire directory (BE CAREFUL!)

ADTs and SimpleList4 More commands  Files ls -l – show file details chmod – change permissions  user, group, other  rwx,rwx,rwx  chmod 640 = user: rw, group: r, other: none  chmod g+w = add group write permission

ADTs and SimpleList5 Running Programs and Redirection  Safest:./program  Redirection program > filename (cout  file) program < filename (cin  file) program file2 program1 | program2 (output of program1 becomes cin for program2)  Examples: ls > file, more < file, ls | more

ADTs and SimpleList6 The VI text editor  VI  Two modes: command and editing  Use to get to command mode  Be careful with CAPS LOCK  Basic commands i = insert text (go to editing mode) :w = write changes (save) :wq = save and exit (or ZZ) :q! = exit without saving

ADTs and SimpleList7 Cursor Movement  Switch to command mode Arrow keys or (k , j , h , l  ) to move around ^f / ^b = forward/back 1 screenfull ^d / ^u = down/up ½ screenful H / L = move cursor to top / bottom of screen 0 (zero) / $ = move cursor to start / end of line G = go to last line of the file #G = go to line number # of the file (useful for debugging)

ADTs and SimpleList8 Text Operations  x = delete one character  D = delete to end of line  dd = delete entire line  dw = delete word  r = replace one character  R = replace until escape is pressed  i = insert characters (edit mode)  a = append characters (edit mode)  o = “open” a new blank line (edit mode)  J = join this line with the next one

ADTs and SimpleList9 Tips  # followed by a command is very handy 29dd = delete 29 lines 34G = go to line  = move 17 characters to the right 5dw = delete 5 words  Period (.) in command mode repeats last command Can be combined with the above  yy = “yank” (copy) one line, p = paste Paste works after delete commands (dd, dw,etc.) too

ADTs and SimpleList10 Lnode Slist Compiling Lnode.h Slist.h Slist.cpp Slist_main.cpp g++ -c Slist.cpp g++ -c Slist_main.cpp g++ -o slist Slist.o Slist_main.o

ADTs and SimpleList11 Dependency Tree slist Slist_main.o Slist_main.cppLnode.hSlist.h Slist.o Slist.cppSlist.hLnode.h

ADTs and SimpleList12 Makefile # M. Raymer -- 9/2004 # CS 400/ Data Structures and Software Design # # Use the following CFLAGS for debugging CFLAGS= -g -ggdb -DUNIX # Use these CFLAGS for optimized, non-debugging code #CFLAGS= -O -DUNIX CC= g++ slist: Slist.o Slist_main.o $(CC) $(CFLAGS) -o slist Slist.o Slist_main.o Slist.o: Slist.h Slist.cpp Lnode.h $(CC) $(CFLAGS) -c Slist.cpp Slist_main.o: Slist_main.cpp Slist.h Lnode.h $(CC) $(CFLAGS) -c Slist_main.cpp clean: rm -f *.o slist Must be a tab character!