Unix Tutorial - Advanced
Unix Tutorial - Advanced
Shelling,
Topics Covered
Why Unix? Brief History Architecture Inter-process Communication Filesystem Regular Expressions Program Execution
PATH to enlightenment Dynamic Linking
root:/ $
The Shells
BASH Programming Shell Startup Short-cuts
Cool Commands
Distributions A particular Flavor will be packaged and marketed through various Distributions
FreeBSD, RedHat, Gentoo
Other version designations The kernel and various software tools and applications each have their own version numbering
X11R6, Linux 2.6, Perl 5.6
Kernel manages core resources Processes Memory (physical and virtual) Interprocess communication (IPC) presents to users: system calls device files
Application:
commands ls, qsub, run-time environment bash, perl, python, Java, PHP, mozilla subsystem X Windows, SGE
Shared libraries:
glibc, gtk
Each application is in its own process and has its own private data. The code can be shared across instances. Each process runs under the permissions of the user that started it effective user id The application and its libraries make system calls and operates on files.
Inter-Process Communication
RPC Signals
RPC Signals
RPC Signals
*otheus* ~/eg$ rpcinfo -p | uniq -f 4 program vers proto 100000 2 tcp 100024 1 udp 100007 2 udp 100004 2 udp 100009 1 udp 100011 1 udp 100003 2 udp 100021 1 udp 100005 1 udp port 111 32768 856 845 878 640 2049 32774 686
Signals
UNIX Filesystem
Promiscuous Permissions
Promiscuous Permissions
Promiscuous Permissions
Promiscuous Permissions
Promiscuous Permissions
Permissions
Permissions
Permissions
Permissions
4 bits:
Read Write Execute Special
4 bits:
Read Write Execute Special
Regular Expressions
10
Program Execution
11
12
The Shells
The Shells
Run applications and commands
Interactively Batch mode In parallel
The Shells
Run applications and commands Interact with Files
Send files to commands. Send commands output to files.
13
The Shells
Run applications and commands Interact with Files Manage environment used by applications
Environment variables File creation mask
The Shells
Flavors
Bourne (sh)
Korn (ksh) Bourne-Again (bash) Almquist (ash) Z shell (zsh)
C Shell (csh)
tcsh
Exotic
fish zoidberg
GUI
Konqueror
Text-GUI
Midnight Commander (mc)
The Shells
Mans Best Friend help (BASH only) man
more or less man k man (Solaris) man (GNU/BSD)
info
14
The Shells
Mans Best Friend help (BASH only) man info
Hyperlink viewer CTRL-H --vi-keys
File: info.info, Node: Top, arted, Up: (dir) Info: An Introduction ********************* The GNU Project distributes most of its on-lin\ e manuals in the "Info format", which you read using an "Info reader"\ . You are probably using an Info reader to read this now. If you are new to the Info reader and want \ to learn how to use it, type the command `h' now. It brings you to a \ programmed instruction --zz-Info: (info.info.gz)Top, 35 lines --Top--Basic Commands in Info Windows ****************************** C-x 0 C-x C-c h Quit this help. Quit Info altogether. Invoke the Info tutorial. Next: Getting St\
Selecting other nodes: ---------------------n Move to the "next" node of this no\ de. p Move to the "previous" node of thi\ s node. u Move "up" from this node. m Pick menu item specified by name. -----Info: *Info Help*, 763 lines --Top-------No cross references in this node.
15
16
17
18
Functions
Functions
19
Functions
Functions
Functions
20
Functions
Functions
21
Shell Startup
22
Cool Commands
23
Cool Commands
Cool Commands
Cool Commands
24
Complex Examples
Complex Examples
Complex Examples
25
Complex Examples
Complex Examples
Complex Examples
26