Introduction To UNIX: Orientation For Fresh VDTT Students
Introduction To UNIX: Orientation For Fresh VDTT Students
Introduction to UNIX
July 28, 2001
IIT Delhi
Slide 1
Anup Gangwar
Overview
Prerequisites and goals of this course
Differences between UNIX and Windows
Overview of unices
Basic UNIX commands and utilities
Lunch Break
File editors in UNIX
Programming and Shell Scripting
Document formatting using UNIX
References and further study
Thank You
IIT Delhi
Slide 2
IIT Delhi
Slide 3
IIT Delhi
Slide 4
Overview of Unices-1
IIT Delhi
Slide 5
Overview of Unices-2
HP-UX
Processors: HP PA-RISC and Intel Itanium
Vendors: HP
Markets: High End Servers and Workstations
Solaris/SunOS
IIT Delhi
Slide 6
Overview of Unices-3
Linux/GNU Systems
Processors: Intel 386 and up, Sun Ultra Sparc, IBM
PowerPC etc.
Vendors: Free/GNU GPL
Markets: Low End Servers and Workstations
IIT Delhi
Slide 7
Overview of Unices-4
IRIX
Processors: MIPS
Vendors: SGI (Silicon Graphics International)
Markets: High End Graphics Servers and Workstations
Others
IIT Delhi
Slide 8
What we have
Philips VLSI Design Lab
HP Server running HP-UX
Sun Workstation
Linux Workstations
VDTT Lab
Linux Workstations
Windows NT Workstations
IIT Delhi
Slide 9
Sun Workstations
Windows NT Workstations
Tips:
IIT Delhi
Slide 10
IIT Delhi
Slide 11
IIT Delhi
Slide 12
Taking backups
Tarring, zipping, gzipping and compressing
Comparison with winzip and common filename extensions
Tips:
IIT Delhi
Slide 13
Tips:
IIT Delhi
Slide 14
IIT Delhi
Slide 15
Lunch Break
Editors in UNIX-1
What all is available, Vi, Emacs, Pico, Joe?, Nedit?
Vi: The king of all editors? Tutorial?
Why learn vi?
Getting in and out?
Basic keys for editing
Moving around, deleting, joining lines
Repeating commands
Search and replace
Tips:
IIT Delhi
Slide 16
Vim is not Vi
Learn the keypad scroll key combinations instead of arrow keys
Vi is fast, try to make the best use of its capabilities
Editors in UNIX-2
Emacs: Much more than an editor?
Why learn Emacs? History, Tutorial
Getting in and out?
Basic keys for editing
IIT Delhi
Slide 17
Editors in UNIX-3
Pico: Is there really a need?
Pico and Pine
Editor Keys
Joe?, Nedit?
Keys similar to Norton Editor
Nedit has some features similar to Emacs
Tips:
IIT Delhi
Slide 18
Programming on UNIX-1
IIT Delhi
Slide 19
Programming on UNIX-2
Gcc, The GNU C/C++ compiler
Simplest possible way to use: gcc <file-name>
Common options
output filename: -o
compile only: -c
Warnings: -Wall
optimizations: -O{1,2,3,4}
Debug: -g
Linking: -l<library-name>
Tips:
IIT Delhi
Slide 20
Programming on UNIX-3
Ld, The Linker
The -l option
The -L option
The LD_LIBRARY_PATH environment variable
The LD_RUN_PATH environment variable
Tips:
IIT Delhi
Slide 21
Programming on UNIX-4
Gdb, The GNU C/C++ debugger
Why is a debugger needed?
gdb and ?core? File
Common commands
list
run, break, resume
backtrace and where
Tips:
IIT Delhi
Slide 22
Programming on UNIX-5
Gmake or GNU make
What is the need for a Makefile?
Dependencies
Targets in a makefile
Patterns in makefile
Automatic variables in a makefile
Pattern substitution
Common target names: all, clean, docs
Tips:
IIT Delhi
Slide 23
Programming on UNIX-6
Example of a makefile
CC=gcc
IIT Delhi
Slide 24
COPTS= -g -Wall
TARGET=run.x
SRCS=hello.c junk.c
OBJS=$(SRCS:.c=.o)
all:$(OBJS)
$(CC) $(COPTS) $(OBJS) -o $(TARGET)
clean:
rm -f $(OBJS) core
%.o:%.c
$(CC) $(COPTS) -c $<
Programming on UNIX-7
GUI in UNIX?
Tips:
IIT Delhi
Slide 25
Programming on UNIX-8
Java
What is really different with the windows version?
Is Jfc, Java2D, Java3D available?
IDEs for Java over UNIX?
Tips:
IIT Delhi
Slide 26
Tips:
IIT Delhi
Slide 27
IIT Delhi
Slide 28
done
IIT Delhi
Slide 29
#!/bin/csh -f
# Assume that ps, pdf etc. directories are present
set FILE_LIST=`ls`
foreach CURR_FILE ( $FILE_LIST )
set TST=`echo $CURR_FILE | grep \.pdf\$ `
if( $TST != "" ) then
mv $CURR_FILE pdf
endif
set TST=`echo $CURR_FILE | grep \.ps\$ `
if( $TST != "" ) then
mv $CURR_FILE ps
endif
end
IIT Delhi
Slide 30
IIT Delhi
Slide 31
Before wrapping up
IIT Delhi
Slide 32
Wrapping up
Self help is the best help!
The UNIX man pages. ?Manual sections?
Using man, whatis etc.
Experiment. You can never kill the system.
Links
Books
Embedded Systems Group
IIT Delhi
Slide 33
IIT Delhi
Slide 34
Thank You