Title: ITR3 lecture 7: more introduction to UNIX
1ITR3 lecture 7more introduction to UNIX
- Thomas Krichel
- 2002-11-05
2 ze olde UNIX Philosophy
- Make each program do one thing well.
- These programs are sometimes called tools.
- Expect the output of every program to be the
input to another yet unknown program. - Simple tools can be connected to accomplish a
complex task - Do not hesitate to build new tools
- The UNIX tool library keeps growing
3Layers in the UNIX System
User Interface
Users
Library Interface
Standard Utility Programs (shell, editors,
compilers, etc.)
System Interface calls
User Mode
Standard Library (open, close read, write, etc.)
UNIX Operating System (process management, memory
management, the file system, I/O, etc.)
Kernel Mode
Hardware (cpu, memory, disks, terminals, etc.)
4UNIX Structure
- The kernel is the core of the UNIX system,
controlling the system hardware and performing
various low-level functions. The other parts of
the UNIX system, as well as user programs, call
on the kernel to perform services for them. - The shell is the command interpreter for the UNIX
system. The shell accepts user commands and is
responsible for seeing that they are carried out.
5Famous shells
- The Bourne shell /bin/sh (default)
- The Korn shell /bin/ksh
- The C shell /bin/csh
- The Bourne Again Shell /bin/bash
- The Z shell /bin/zsh
- In linux, /bin/sh is usually /bin/bash
6stdin, stdout, stderr
- Stand for standard input, output and error,
- Normally keyboard, screen, screen
- Can redirect
- gt file redirect output to a file
- gtgt file redirect output to append a file
- lt file use input from file
- 2gt file redirect error to a file
- 2gtgt file redirect error to append a file
7pipe
- The vertical bar takes the output and makes it
the input of another program. - Example how many files do I have?
- ls grep c
- What is the most recent files?
- ls t tail -1
8Machine access
- Console access
- Network access
- Need to know the IP number
- That number may be changed by the LIU network.
- Run a scheduled job to report the number to
wotan, which itself has a static number and name.
9cron
- cron is a daemon that runs scheduled jobs.
- crontab file set a file file to be the schedule.
Changing the file does not change the crontab. - The schedule file has a list of times and a list
of command that are being executed. - crontab l lists the crontab
- crontab r removes it.
10Contab structure
- Minute hour day of month month day of
the week - Day of the week goes 0 to 6, 0 is Sunday.
- means any
- Followed by the command, for example
- 46 5 rsync --delete -qa /home/krichel
krichel_at_wotan.liu.edursync/arcano/home gt
/dev/null 2gt /dev/null
11Internet configuration
- You request an IP address using dhcp from your
provider with dhclient. There are many ways in
which the client can be configured. - You get a report of the configuration of the
Internet access with /sbin/ifconfig. - You need to put this in a file
- /sbin/ifconfig gt host.if
- where host is your host name
- Copy this file to wotan account
- scp host.if _at_wotan.liu.edu
- Put this is the crontab, every hour, say.
12UNIX Structure
- Hundreds of applications are supplied with the
UNIX system. They support a variety of tasks - copying files
- editing text
- performing calculations
- developing software
- Serving web pages etc
13naming
- DNS attaches names to machines on the Internet.
This allows us to keep names - Names are used in collections called domains.
Domains must be registered. - Thomas has a DNS server for the domain
openlib.org - Thomas can write an application that will take
the different .if files, and collect them on
fafner, and create a file will provide with a
zone that will name in the itr3.openlib.org
domain, as host.itr3.openlib.org
14Name calling
- Not officially allowed. The University only wants
.liu.edu names for machines in the University
network. And of course they own the domain and
operate the server. - Nevertheless, I could demonstrate how this could
work. - Probably next week .
15dselect
- Is the main tool to add and remove software.
- You have to do this as root.
- Set the distribution to be the testing.
- Set the apt method for getting package files.
- You can also add non-official sources
- http//www.braincells.com/debian sid/ for pine
for example
16Package conflicts
- When you install packages that require others
that are not there yet, or when you remove
packages that others depend on, the system will
prompt you. - Typing R at this stage will get you back.
- It pays to look at the keystrokes that you can do
in dselect and learn the most important ones - / search \ repeat search select - deselect
17Dselect
- Update updates the package list, gets you the
latest version of all packages. - Install does the installation
- Configure seems no longer being used
- Remove seems no longer being used, removals are
done by Install
18http//openlib.org/home/krichel
- Thank you for your attention!