CS11001/CS11002 Programming and Data Structures Autumn/Spring Semesters. Introduction

Similar documents
CS11002 Programming and Data Structures Spring Introduction

CS19001/CS19002 Programming and Data Structures Lab Autumn/Spring Semester. Introduction. Abhijit Das. January 4, 2015

Programming and Data Structure Laboratory (CS13002)

Parallel Programming Pre-Assignment. Setting up the Software Environment

Lab 1 Introduction to UNIX and C

Introduction to Linux. Fundamentals of Computer Science

COMP1917: Computing 1 1. Introduction

Laboratory 1 Semester 1 11/12

1. The Mac Environment in Sierra Hall 1242

Lab 1 Introduction to UNIX and C

Hrs Hrs Hrs Hrs Hrs Marks Marks Marks Marks Marks

Intermediate Programming, Spring Misha Kazhdan

Saint Louis University. Intro to Linux and C. CSCI 2400/ ECE 3217: Computer Architecture. Instructors: David Ferry

CS 2400 Laboratory Assignment #1: Exercises in Compilation and the UNIX Programming Environment (100 pts.)

Oregon State University School of Electrical Engineering and Computer Science. CS 261 Recitation 1. Spring 2011

COMP1917: Computing 1 1. Introduction

1. The Mac Environment in SIE 1222

Partha Sarathi Mandal

EL2310 Scientific Programming

gcc hello.c a.out Hello, world gcc -o hello hello.c hello Hello, world

Swami Ramanand Teerth Marathwada University, Nanded

1. Introduction. Course Web Site. COMP1917: Computing 1. Textbook. Occupational Health and Safety (OHS)

Course Information and Introduction

AMS 200: Working on Linux/Unix Machines

Exercise 1: Basic Tools

EL2310 Scientific Programming

Using the Unix system. UNIX Introduction

CMPUT 201: Practical Programming Methodology. Guohui Lin Department of Computing Science University of Alberta September 2018

CpSc 1111 Lab 1 Introduction to Unix Systems, Editors, and C

CMPT 300. Operating Systems. Brief Intro to UNIX and C

Lab 1 1 Due Wed., 2 Sept. 2015

Linux/Cygwin Practice Computer Architecture

We first learn one useful option of gcc. Copy the following C source file to your

CIS* Programming

Chapter 1 An Introduction to C++, Unix, SSH and Komodo Edit

Practical Session 0 Introduction to Linux

Problem Set 1: Unix Commands 1

Kadi Sarva Vishwavidyalaya, Gandhinagar

Introduction to Algorithms and Programming I Lab. Exercises #1 Solution

Unit 10. Linux Operating System

SU2017. LAB 1 (May 4/9) Introduction to C, Function Declaration vs. Definition, Basic I/O (scanf/printf, getchar/putchar)

EECS2031 Software Tools

CSC111 Computer Science II

Lecture 1. A. Sahu and S. V. Rao. Indian Institute of Technology Guwahati

Problem Solving and 'C' Programming

Introduction to the UNIX command line

CPS109 Lab 1. i. To become familiar with the Ryerson Computer Science laboratory environment.

Getting Started With UNIX Lab Exercises

Introduction: The Unix shell and C programming

CS 112: Intro to Comp Prog

CS CS Tutorial 2 2 Winter 2018

3/13/2012. ESc101: Introduction to Computers and Programming Languages

27-Sep CSCI 2132 Software Development Lab 4: Exploring bash and C Compilation. Faculty of Computer Science, Dalhousie University

Operating System Labs. Yuanbin Wu

CS 211 Programming I for Engineers

Course Contents/Syllabus: Weightage (%) Module I: Introduction to operating system: 15

PDS Lab Section 16 Autumn Tutorial 1. Unix Commands pwd The pwd command displays the full pathname of the current directory.

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

Academic Programme: B.Sc. I Year. Computer Science (Optional) Hours. Fundamentals of Computer Hours.

Parallel Programming Pre-Assignment. Setting up the Software Environment

Tutorial 1: Unix Basics

Temple University Computer Science Programming Under the Linux Operating System January 2017

PROGRAMME: COMPUTER SCIENCE & ENGINEERING COURSE: Operating System Lab SEMESTER: VI CREDITS: 2

Course Title: C Programming Full Marks: Course no: CSC110 Pass Marks: Nature of course: Theory + Lab Credit hours: 3

Your Instructor. CSE Content. Notes. Notes. Notes. Summer May 4, 2010

CMSC 104 Lecture 2 by S Lupoli adapted by C Grasso

Brief Linux Presentation. July 10th, 2006 Elan Borenstein

CS133 C Programming. Instructor: Jialiang Lu Office: Information Center 703

Compiling C/C++ programs

CMSC 201 Spring 2018 Lab 01 Hello World

Introduction to Supercomputing

Unit 13. Linux Operating System Debugging Programs

Introduction to Cygwin Operating Environment

Warm-up sheet: Programming in C

Getting started with UNIX/Linux for G51PRG and G51CSA

BIRLA INSTITUTE OF TECHNOLOGY AND SCIENCE, Pilani Pilani Campus Instruction Division. SECOND SEMESTER Course Handout Part II

System Programming. Introduction to Unix

Practical Computing-II. Programming in the Linux Environment. 0. An Introduction. B.W.Gore. March 20, 2015

C Language Part 1 Digital Computer Concept and Practice Copyright 2012 by Jaejin Lee

COL100 Lab 9. I semester Week 9, To be able to write C programs involving functions and recursion.

BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description:

Gujarat University M. Sc. Computer Science [S. F.] Semester-1 Syllabus Gujarat Arts & Science College, Ahmedabad.

ENGINEERING PROGRAMMING

CP Lab 1: Introduction to DICE and the C compiler

Proposed Syllabus for F.Y.B.Sc.( Computer Science) North Maharashtra University, Jalgaon. F.Y.B.Sc.( Computer Science) (w.e.f.

15-122: Principles of Imperative Computation

Introduction to Linux

Chapter 1 An Introduction to C++, Unix, SSH and Komodo Edit

Introduction to Unix - Lab Exercise 0

Basic Unix Commands. CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang

CMSC 201 Spring 2017 Lab 01 Hello World

B.Sc. Final B.SC. PART-III PAPER I COMPUTER ORGANIZATION II

Getting Started with UNIX

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University

CpSc 1111 Lab 9 2-D Arrays

Tiny Instruction Manual for the Undergraduate Mathematics Unix Laboratory

Problem Solving and 'C' Programming

EKT332 COMPUTER NETWORK

Organization of a computer

CS Fundamentals of Programming II Fall Very Basic UNIX

Transcription:

Title page CS11001/CS11002 Programming and Data Structures Autumn/Spring Semesters Introduction Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Last modified: July 8, 2010

Syllabus Syllabus

Syllabus Syllabus Introduction to digital computers

Syllabus Syllabus Introduction to digital computers Basic programming constructs Variables and simple data types Assignments Input/output Conditions and branching Loops and iteration Iterative searching and sorting algorithms

Syllabus Syllabus Introduction to digital computers Basic programming constructs Variables and simple data types Assignments Input/output Conditions and branching Loops and iteration Iterative searching and sorting algorithms Advanced programming constructs Functions and recursion Recursive sorting algorithms Arrays and strings Structures Pointers and dynamic memory allocation

Syllabus Syllabus (contd.)

Syllabus Syllabus (contd.) Performance analysis of programs

Syllabus Syllabus (contd.) Performance analysis of programs Data structures Abstract data types Ordered lists Stacks and queues

Syllabus Syllabus (contd.) Performance analysis of programs Data structures Abstract data types Ordered lists Stacks and queues Programming language: C

References On C Textbooks and references

References On C Textbooks and references Use any standard textbook on ANSI C

References On C Textbooks and references Use any standard textbook on ANSI C Do not use books written on specific C compilers (Turbo C, gcc)

References On C Textbooks and references Use any standard textbook on ANSI C Do not use books written on specific C compilers (Turbo C, gcc) 1 Brian W. Kernighan and Dennis M. Ritchie, The C Programming Language, Prentice Hall of India. 2 E. Balaguruswamy, Programming in ANSI C, Tata McGraw-Hill. 3 Byron Gottfried, Schaum s Outline of Programming with C, McGraw-Hill. 4 P. Dey and M. Ghosh, Programming in C, Oxford University Press.

References On data structures Textbooks and references

References On data structures Textbooks and references 5 Seymour Lipschutz, Data Structures, Schaum s Outlines Series, Tata McGraw-Hill. 6 Ellis Horowitz, Satraj Sahni and Susan Anderson-Freed, Fundamentals of Data Structures in C, W. H. Freeman and Company. 7 R. G. Dromey, How to Solve it by Computer, Prentice-Hall of India.

References On data structures Textbooks and references 5 Seymour Lipschutz, Data Structures, Schaum s Outlines Series, Tata McGraw-Hill. 6 Ellis Horowitz, Satraj Sahni and Susan Anderson-Freed, Fundamentals of Data Structures in C, W. H. Freeman and Company. 7 R. G. Dromey, How to Solve it by Computer, Prentice-Hall of India. 8 http://cse.iitkgp.ac.in/ pds/notes/ 9 http://cse.iitkgp.ac.in/ pds/notes/swf/

Marks distribution Marks distribution

Marks distribution Marks distribution Two class tests: 10 2 = 20

Marks distribution Marks distribution Two class tests: 10 2 = 20 Mid-semester test: 30

Marks distribution Marks distribution Two class tests: 10 2 = 20 Mid-semester test: 30 End-semester test: 50

Marks distribution Marks distribution Two class tests: 10 2 = 20 Mid-semester test: 30 End-semester test: 50 Final marks of a student: M = m α, where

Marks distribution Marks distribution Two class tests: 10 2 = 20 Mid-semester test: 30 End-semester test: 50 Final marks of a student: M = m α, where m = Total marks obtained in 100, and

Marks distribution Marks distribution Two class tests: 10 2 = 20 Mid-semester test: 30 End-semester test: 50 Final marks of a student: M = m α, where m = Total marks obtained in 100, and α = Classes attended / Total number of classes.

Test schedule (tentative) Tentative schedule of theory tests

Test schedule (tentative) Tentative schedule of theory tests Class Test 1: First week of September/February

Test schedule (tentative) Tentative schedule of theory tests Class Test 1: First week of September/February Mid-semester Test: As per institute schedule

Test schedule (tentative) Tentative schedule of theory tests Class Test 1: First week of September/February Mid-semester Test: As per institute schedule Class Test 2: First week of November/April

Test schedule (tentative) Tentative schedule of theory tests Class Test 1: First week of September/February Mid-semester Test: As per institute schedule Class Test 2: First week of November/April End-Semester Test: As per institute schedule

Test schedule (tentative) Tentative schedule of theory tests Class Test 1: First week of September/February Mid-semester Test: As per institute schedule Class Test 2: First week of November/April End-Semester Test: As per institute schedule Two or three lab tests are conducted by respective lab instructors

Coverage schedule Tentative schedule for coverage

Coverage schedule Tentative schedule for coverage Before Class Test 1: Until iterations (all loop constructs)

Coverage schedule Tentative schedule for coverage Before Class Test 1: Until iterations (all loop constructs) Before MidSem Test: Until introduction to pointers

Coverage schedule Tentative schedule for coverage Before Class Test 1: Until iterations (all loop constructs) Before MidSem Test: Until introduction to pointers Before Class Test 2: Until linked structures

Coverage schedule Tentative schedule for coverage Before Class Test 1: Until iterations (all loop constructs) Before MidSem Test: Until introduction to pointers Before Class Test 2: Until linked structures Before EndSem Test: Everything

Structure of a C program How to write C programs Skeleton of a C program

Structure of a C program How to write C programs Skeleton of a C program Include header files

Structure of a C program How to write C programs Skeleton of a C program Include header files Declare global variables, constants and function prototypes

Structure of a C program How to write C programs Skeleton of a C program Include header files Declare global variables, constants and function prototypes Function bodies

Structure of a C program How to write C programs Skeleton of a C program Include header files Declare global variables, constants and function prototypes Function bodies There must be a main function in any C program.

Structure of a C program An example A complete example #include <stdio.h> #define PI_4_BY_3 4.1887902048 double radius = 10; double spherevol ( double r ) { return PI_4_BY_3 * r * r * r; } main () { double area; area = spherevol(radius); printf("radius = %lf, volume = %lf.\n", radius, area); }

Some simple C programs The traditional starter The traditional starter #include <stdio.h> main () { printf("hello, world!\n"); }

Some simple C programs The traditional starter The traditional starter #include <stdio.h> main () { printf("hello, world!\n"); } This program takes no input, but outputs the string Hello, world! in a line.

Some simple C programs The short-circuit program The short-circuit program #include <stdio.h> main () { int n; } scanf("%d",&n); printf("%d\n",n);

Some simple C programs The short-circuit program The short-circuit program #include <stdio.h> main () { int n; } scanf("%d",&n); printf("%d\n",n); This program accepts an integer as input and outputs the same integer.

Some simple C programs The square finder The square finder #include <stdio.h> main () { int n; } scanf("%d",&n); printf("%d\n",n*n);

Some simple C programs The square finder The square finder #include <stdio.h> main () { int n; } scanf("%d",&n); printf("%d\n",n*n); This program takes an integer n as input and outputs the square n 2 of n.

Some simple C programs A faulty reciprocal finder A faulty reciprocal finder #include <stdio.h> main () { int n; } scanf("%d",&n); printf("%d\n",1/n);

Some simple C programs A faulty reciprocal finder A faulty reciprocal finder #include <stdio.h> main () { int n; } scanf("%d",&n); printf("%d\n",1/n); The division 1/n is of integers (quotient).

Some simple C programs A faulty reciprocal finder A faulty reciprocal finder #include <stdio.h> main () { int n; } scanf("%d",&n); printf("%d\n",1/n); The division 1/n is of integers (quotient). The format %d is for printing integers.

Some simple C programs The correct reciprocal finder The correct reciprocal finder #include <stdio.h> main () { int n; } scanf("%d",&n); printf("%f\n",1.0/n);

PDS Laboratory

Log in Getting started

Log in Getting started Switch on your monitor.

Log in Getting started Switch on your monitor. Switch on your PC.

Log in Getting started Switch on your monitor. Switch on your PC. Allow the machine to boot. Wait until the log in prompt comes.

Log in Getting started Switch on your monitor. Switch on your PC. Allow the machine to boot. Wait until the log in prompt comes. Supply your log-in and password: Login: s<nn> Password: s<nn> Here s is your section (a for 1, b for 2, and so on) <nn> is the number of your PC. This opens your window manager (usually KDE) with icons, the bottom panel, and so on. You are now ready to start your work.

Edit, compile and run Getting started

Edit, compile and run Getting started Click on the terminal icon to open a shell (command prompt).

Edit, compile and run Getting started Click on the terminal icon to open a shell (command prompt). Edit your program (new or already existing) by an editor. emacs myprog.c &

Edit, compile and run Getting started Click on the terminal icon to open a shell (command prompt). Edit your program (new or already existing) by an editor. emacs myprog.c & Write your program in the editor and save it.

Edit, compile and run Getting started Click on the terminal icon to open a shell (command prompt). Edit your program (new or already existing) by an editor. emacs myprog.c & Write your program in the editor and save it. Go to the shell and compile your program: cc myprog.c If compilation is successful, an executable called a.out will be created.

Edit, compile and run Getting started Click on the terminal icon to open a shell (command prompt). Edit your program (new or already existing) by an editor. emacs myprog.c & Write your program in the editor and save it. Go to the shell and compile your program: cc myprog.c If compilation is successful, an executable called a.out will be created. Run your program:./a.out

Edit, compile and run Getting started Click on the terminal icon to open a shell (command prompt). Edit your program (new or already existing) by an editor. emacs myprog.c & Write your program in the editor and save it. Go to the shell and compile your program: cc myprog.c If compilation is successful, an executable called a.out will be created. Run your program:./a.out Continue your edit-compile-debug-run-debug cycle.

Shut down Getting started

Shut down Getting started Close all the windows you opened.

Shut down Getting started Close all the windows you opened. Log out from your window manager. This leaves you again in the log-in console.

Shut down Getting started Close all the windows you opened. Log out from your window manager. This leaves you again in the log-in console. Select the item to shut down the machine. Wait until the machine completely shuts down.

Shut down Getting started Close all the windows you opened. Log out from your window manager. This leaves you again in the log-in console. Select the item to shut down the machine. Wait until the machine completely shuts down. Switch off your monitor.

Using emacs Using emacs

Using emacs Using emacs emacs is a powerful text editor.

Using emacs Using emacs emacs is a powerful text editor. Run emacs as: emacs myprog.c &

Using emacs Using emacs emacs is a powerful text editor. Run emacs as: emacs myprog.c & Type in your program in the text area

Using emacs Using emacs emacs is a powerful text editor. Run emacs as: emacs myprog.c & Type in your program in the text area Navigate with mouse and cursor keys

Using emacs Using emacs emacs is a powerful text editor. Run emacs as: emacs myprog.c & Type in your program in the text area Navigate with mouse and cursor keys Save your file before closing emacs.

Using emacs Using emacs emacs is a powerful text editor. Run emacs as: emacs myprog.c & Type in your program in the text area Navigate with mouse and cursor keys Save your file before closing emacs. File -> Save (Current buffer)

Using emacs Using emacs emacs is a powerful text editor. Run emacs as: emacs myprog.c & Type in your program in the text area Navigate with mouse and cursor keys Save your file before closing emacs. File -> Save (Current buffer) Click the save button (disk)

Using emacs Using emacs emacs is a powerful text editor. Run emacs as: emacs myprog.c & Type in your program in the text area Navigate with mouse and cursor keys Save your file before closing emacs. File -> Save (Current buffer) Click the save button (disk) File -> Save buffer as (to another file)

Using emacs Using emacs emacs is a powerful text editor. Run emacs as: emacs myprog.c & Type in your program in the text area Navigate with mouse and cursor keys Save your file before closing emacs. File -> Save (Current buffer) Click the save button (disk) File -> Save buffer as (to another file) Save your file once in every 15 minutes.

Using gvim Using gvim

Using gvim Using gvim gvim is another powerful text editor.

Using gvim Using gvim gvim is another powerful text editor. Run gvim as: gvim myprog.c

Using gvim Using gvim gvim is another powerful text editor. Run gvim as: gvim myprog.c Hit Insert before you start typing matter

Using gvim Using gvim gvim is another powerful text editor. Run gvim as: gvim myprog.c Hit Insert before you start typing matter You will exit the insert mode if you hit Insert when you are already in the insert mode

Using gvim Using gvim gvim is another powerful text editor. Run gvim as: gvim myprog.c Hit Insert before you start typing matter You will exit the insert mode if you hit Insert when you are already in the insert mode Hit Esc to exit insert mode

Using gvim Using gvim gvim is another powerful text editor. Run gvim as: gvim myprog.c Hit Insert before you start typing matter You will exit the insert mode if you hit Insert when you are already in the insert mode Hit Esc to exit insert mode When in doubt, it is safe to hit Esc several times to come back to view mode

Using gvim Using gvim gvim is another powerful text editor. Run gvim as: gvim myprog.c Hit Insert before you start typing matter You will exit the insert mode if you hit Insert when you are already in the insert mode Hit Esc to exit insert mode When in doubt, it is safe to hit Esc several times to come back to view mode Navigate with mouse and cursor keys

Using gvim Using gvim gvim is another powerful text editor. Run gvim as: gvim myprog.c Hit Insert before you start typing matter You will exit the insert mode if you hit Insert when you are already in the insert mode Hit Esc to exit insert mode When in doubt, it is safe to hit Esc several times to come back to view mode Navigate with mouse and cursor keys You need to save the file by clicking on the appropriate icon (disk).

Using gvim Using gvim gvim is another powerful text editor. Run gvim as: gvim myprog.c Hit Insert before you start typing matter You will exit the insert mode if you hit Insert when you are already in the insert mode Hit Esc to exit insert mode When in doubt, it is safe to hit Esc several times to come back to view mode Navigate with mouse and cursor keys You need to save the file by clicking on the appropriate icon (disk). Save your file once in every 15 minutes.

A practice program A practice program #include <stdio.h> char name[100]; int i; main () { printf("hello, may I know your full name? "); scanf("%s",name); printf("welcome %s.\n",name); printf("your name printed backward is : "); for (i=strlen(name)-1; i>=0; --i) printf("%c",name[i]); printf("\n"); }

A corrected version A practice program (corrected) #include <stdio.h> char name[100]; int i; main () { printf("hello, may I know your full name? "); fgets(name,100,stdin); name[strlen(name)-1] = \0 ; printf("welcome %s.\n",name); printf("your name printed backward is : "); for (i=strlen(name)-1; i>=0; --i) printf("%c",name[i]); printf("\n"); }

Using a web browser Using a web browser

Using a web browser Using a web browser Open a web browser: mozilla or konqueror.

Using a web browser Using a web browser Open a web browser: mozilla or konqueror. Set a proxy:

Using a web browser Using a web browser Open a web browser: mozilla or konqueror. Set a proxy: 10.3.100.211:8080 10.3.100.212:8080 144.16.192.218:8080 144.16.192.245:8080 144.16.192.247:8080

Using a web browser Using a web browser Open a web browser: mozilla or konqueror. Set a proxy: 10.3.100.211:8080 10.3.100.212:8080 144.16.192.218:8080 144.16.192.245:8080 144.16.192.247:8080 Bypass proxy for local machines.

Using a web browser Using a web browser Open a web browser: mozilla or konqueror. Set a proxy: 10.3.100.211:8080 10.3.100.212:8080 144.16.192.218:8080 144.16.192.245:8080 144.16.192.247:8080 Bypass proxy for local machines. Type in a URL (web address) in the location field

Using a web browser Using a web browser Open a web browser: mozilla or konqueror. Set a proxy: 10.3.100.211:8080 10.3.100.212:8080 144.16.192.218:8080 144.16.192.245:8080 144.16.192.247:8080 Bypass proxy for local machines. Type in a URL (web address) in the location field http://cse.iitkgp.ac.in/ pds/

Using a web browser Using a web browser Open a web browser: mozilla or konqueror. Set a proxy: 10.3.100.211:8080 10.3.100.212:8080 144.16.192.218:8080 144.16.192.245:8080 144.16.192.247:8080 Bypass proxy for local machines. Type in a URL (web address) in the location field http://cse.iitkgp.ac.in/ pds/ http://cse.iitkgp.ac.in/ pds/semester/2010a/

Using a web browser Using a web browser Open a web browser: mozilla or konqueror. Set a proxy: 10.3.100.211:8080 10.3.100.212:8080 144.16.192.218:8080 144.16.192.245:8080 144.16.192.247:8080 Bypass proxy for local machines. Type in a URL (web address) in the location field http://cse.iitkgp.ac.in/ pds/ http://cse.iitkgp.ac.in/ pds/semester/2010a/ http://cse.iitkgp.ac.in/ pds/notes/

Assignments and submissions Assignments and submissions

Assignments and submissions Assignments and submissions Click the link on the day s assignment.

Assignments and submissions Assignments and submissions Click the link on the day s assignment. If your assignment is a PDF file, save it to your machine.

Assignments and submissions Assignments and submissions Click the link on the day s assignment. If your assignment is a PDF file, save it to your machine. Use xpdf in order to view PDF files. xpdf newassgn.pdf

Assignments and submissions Assignments and submissions Click the link on the day s assignment. If your assignment is a PDF file, save it to your machine. Use xpdf in order to view PDF files. xpdf newassgn.pdf Consult your lab instructor to know how to submit your programs.

Some useful Unix commands Some useful Unix commands

Some useful Unix commands Some useful Unix commands Create a directory: mkdir progs

Some useful Unix commands Some useful Unix commands Create a directory: mkdir progs Go to a new directory: cd progs/

Some useful Unix commands Some useful Unix commands Create a directory: mkdir progs Go to a new directory: cd progs/ Go to the parent directory: cd../

Some useful Unix commands Some useful Unix commands Create a directory: mkdir progs Go to a new directory: cd progs/ Go to the parent directory: cd../ List all files in a directory: ls -lf

Some useful Unix commands Some useful Unix commands Create a directory: mkdir progs Go to a new directory: cd progs/ Go to the parent directory: cd../ List all files in a directory: ls -lf View a file: cat filename

Some useful Unix commands Some useful Unix commands Create a directory: mkdir progs Go to a new directory: cd progs/ Go to the parent directory: cd../ List all files in a directory: ls -lf View a file: cat filename Copy a file to another: cp file1.c file2.c

Some useful Unix commands Some useful Unix commands Create a directory: mkdir progs Go to a new directory: cd progs/ Go to the parent directory: cd../ List all files in a directory: ls -lf View a file: cat filename Copy a file to another: cp file1.c file2.c Copy a file to a directory: cp file1.c progs/file3.c

Some useful Unix commands Some useful Unix commands Create a directory: mkdir progs Go to a new directory: cd progs/ Go to the parent directory: cd../ List all files in a directory: ls -lf View a file: cat filename Copy a file to another: cp file1.c file2.c Copy a file to a directory: cp file1.c progs/file3.c Move a file to another: mv file1.c file2.c

Some useful Unix commands Some useful Unix commands Create a directory: mkdir progs Go to a new directory: cd progs/ Go to the parent directory: cd../ List all files in a directory: ls -lf View a file: cat filename Copy a file to another: cp file1.c file2.c Copy a file to a directory: cp file1.c progs/file3.c Move a file to another: mv file1.c file2.c Move a file to a directory: mv file1.c progs/file3.c

Some useful Unix commands Some useful Unix commands Create a directory: mkdir progs Go to a new directory: cd progs/ Go to the parent directory: cd../ List all files in a directory: ls -lf View a file: cat filename Copy a file to another: cp file1.c file2.c Copy a file to a directory: cp file1.c progs/file3.c Move a file to another: mv file1.c file2.c Move a file to a directory: mv file1.c progs/file3.c Delete a file: rm filename