16.05.2015 Views

Working with the Unix OS

Working with the Unix OS

Working with the Unix OS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Introduction to <strong>Unix</strong><br />

! Execution<br />

mame<br />

a.out<br />

executes program in file "name"<br />

default from cc if -0 not used<br />

Command Shells<br />

command interpreter<br />

programming languages<br />

accepts commands while logged in<br />

shell scripts<br />

sh Bourne Shell <strong>the</strong> original<br />

csh C Shell C-like interpretive language<br />

ksh Korn Shell includes all of Bourne shell<br />

tcsh Enhanced C Shell completely compatible to <strong>the</strong> C Shell<br />

Help on-line manuals for commands<br />

man ls<br />

ls manual<br />

man<br />

man manual<br />

man man for any command<br />

man -k keyword search in description<br />

Example:<br />

man -k write ( = apropos -ucb command)<br />

creat(2)<br />

create a new file or rewrite an existing one<br />

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />

UBUNTU, SOLARIS: touch<br />

Usage: touch <br />

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />

fread, fwrite(3S)<br />

lseek(2)<br />

rwall(lM)<br />

rwall(3N)<br />

wall(1M)<br />

write(1)<br />

write, writev(2)<br />

buffered binary input/output to a stream file<br />

move read/write file pointer; seek<br />

write to all users over a network<br />

write to specified remote machines<br />

write to all users<br />

write (talk) to ano<strong>the</strong>r user<br />

write on a file<br />

File Permissions<br />

Example:<br />

ls -1 myfile<br />

0123456789 L User Group Size Last-Updated File-Name<br />

-rwxrwxrwx 1 fred student 2134 Feb 17 14:05 myfile<br />

where:<br />

L: number of links<br />

0: type of file {"-": ordinary, "d": directory}<br />

123: owner (user) rights<br />

456: group rights<br />

789: world (o<strong>the</strong>rs) rights<br />

More specifically, <strong>the</strong> access rights when applied to files or directories are:<br />

Files Directories<br />

147 = "r" read read file names (ls)<br />

258 = "w" write create/delete files (cp, rm)<br />

369 = "x" execute access files in sub-directory (called search permission)<br />

2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!