Introduction to UNIX - Lecture Notes - Systems Programming | CS 476, Study notes of Computer Science

Material Type: Notes; Class: Systems Programming; Subject: Computer Science; University: Old Dominion University; Term: Unknown 1989;

Typology: Study notes

Pre 2010

Uploaded on 02/12/2009

koofers-user-gjt
koofers-user-gjt 🇺🇸

10 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
First:
Login to your Unix account and type:
% /home/cs476/mlist
To put your login name in cs476 mailing list.
Introduction to UNIX
Dot files:
To change the behavior of programs.
Examples: .login, .cshrc, .mailrc, .forward, etc...
Unix Man pages:
Extensive on-line documentation.
Examples: man, info, xman, apropos, whereis, which, etc..
Editing:
You may use any program to edit a file.
Examples: vi, emacs. ed, MS word, notebad, etc...
Debgging:
You may use any debugger to debug a program.
Example: gdb
Bit-level operations:
You may access individual bits of any byte.
Example: bits
Unix file system:
pf3
pf4
pf5

Partial preview of the text

Download Introduction to UNIX - Lecture Notes - Systems Programming | CS 476 and more Study notes Computer Science in PDF only on Docsity!

First:

Login to your Unix account and type:

% /home/cs476/mlist

To put your login name in cs476 mailing list.

Introduction to UNIX

  • Dot files:

To change the behavior of programs. Examples : .login, .cshrc, .mailrc, .forward, etc...

  • Unix Man pages:

Extensive on-line documentation. Examples : man, info, xman, apropos, whereis, which, etc..

  • Editing:

You may use any program to edit a file. Examples : vi, emacs. ed, MS word, notebad, etc...

  • Debgging:

You may use any debugger to debug a program. Example : gdb

  • Bit-level operations:

You may access individual bits of any byte. Example : bits

  • Unix file system:

% ls -l

  • rwx rwx rwx 2 wahab faculty 1278 Aug 25 file

% touch

Example : % mkdir test % cd test

% touch file % ls -l -rw------- 1 wahab faculty 0 Aug 1 23:25 file % touch 1226112272 file /* which touch? */ % ls -l -rw------- 1 wahab faculty 0 Dec 26 1972 file % find

Example :

Remove all files under directory test named a.out or *.o that have not been accessed for a week:

% find ./test ( -name a.out -o -name '*.o' ) -atime + -exec rm {} ; % chmod -R a+rx *

% cp -r path1 path

% rm -r path

  • The cat & tail story:

Creating the world's first chat!

% cat >> /tmp/wahab % tail -f /tmp/wahab

  • Which Shell?

Job control

% sort bigfile1 > bigfile ^Z

% jobs ....... list of background jobs ........... % kill -9 %job

% ps ......... list of processes .................. % kill -9 process

  • Quoting:

\C , '......' , ....... , " ....."

% echo * % echo * quote ONE char % echo '***><?' qoute ANY number of chars % mail cat list < letter command substitution % echo "pwd $home" does not qoute ... and $

  • Shell and Environmnet Variables:

Bourne shell:

$ path=.:/bin:/usr/bin path is a standard shell variable $ echo $path $ d=pwd d is a user defined shell variable $ echo $d

PS: no spaces around =

csh shell:

% set path=.:/bin:/usr/bin % set d = pwd

% setenv DISPLAY dogwood.cs.odu.edu: % echo $DISPLAY

Environment variables: are automatically exported to all child processes. Shell varibales: has to be explicitly exported.

Example:

% set x=pwd % setenv y pwd % echo $x $y % csh % echo $x $y x is undefined but y is defined.