Review for Exam I
Chapter 1 – Introduction
Know how to use man –k to search for a
keyword.
Chapter 2 – Scripting and the Shell
Pipes can be used to connect the standard
output from one process to the standard input of a second process
Commands that reads STDIN and writes STDOUT
can be used as a filter (component of a pipeline)
Regular expressions are a powerful tool for
pattern matching and substitution
To make your script executable, the first
line should be : #! /bin/bash
Chapter 3 - Booting and Shutdown
You will be forced to do a manual boot if
there are any unfixable filesystem problems
Use fsck to fix
filesystem problems
You may be able to use a recovery CD to fix
a system that does not boot
Single-user mode can be used to fix errors
in startup scripts
Linux uses the GRUB boot loader
Chapter 4 – Access Control and Rootly
Powers
UID for root is 0
The UNIX administrator is called superuser whose login is root
It is a best practice to not login as root
Know the other ways you can become superuser without logging in as root (su,
sudo)
Files have an owner and group owner
Process has real and effective UIDs and
GIDs
Chapter 5 – Controlling Processes
A new process is created with the fork
system call
Fork returns the child’s PID to the parent and
0 to the child
When a process exits it returns its exit
code to the parent – init if parent no longer exists
Be able to use the kill command to send a
signal to a process:
kill PID sends TERM signal 15 to process (software termination)
kill -9 PID sends KILL signal to process (cannot be caught)
kill -1 PID sends HUP signal to process (reread config file)
kill -9 -1 sends KILL signal to all your processes (Dangerous!)
Know the different process states: runable, sleeping, swapped, zombie, stopped
The ps command is
used to display the processes on the system
The top command gives a dynamically updated
display of processes
The nice command can be used to raise or
lower the priority of a process when it is started
renice is used to raise (root only) or lower a process’ priority
already running
Chapter 6 – The Filesystem
The commands mount and umount
are used to mount and unmount filesystems:
Types of files:
regular, directories, character and block devices, sockets, pipes, hard
links, symbolic links
You can not use hard links across different
filesystems, must use symbolic links
Know how to create symbolic links: ln –s oldfile
newfile
Know the octal values of setuid and setgid: 4000 and 2000
Executable programs that are setuid/setgid will change the
process’ effective UID and GID
Know how to use chmod: chmod 711 prog
UNIX uses inodes
to keep track of files in a filesystem
Filenames are stored in the parent
directory, not in the files inode
Access Control Lists (ACLs) provide a more complicated
way of regulating access to files
Chapter 7 – Adding Users
It’s best to automate the process of adding
a user
Use vipw to edit
the passwd file
When shadow passwords are used, passwords
are only readable by root and an “x” is put in the password field.
Know how to create a new user’s home
directory:
mkdir /home/tyler
chown
chgrp
users /home/tyler
chmod
700 /home/tyler
The useradd
command automates the process of adding a user
Chapter 31 – Serial Devices
RS-232 is a standard for serial
communication
Not all 25 pins are needed to make a
connection
Modems can be connected using 8 wires
Terminals normally only need to be
connected using 3 wires (with soft carrier)
Connector Types: DB-25 DB-9 DIN-8 RJ-45
(Have male and female versions)
The speed on a serial line is measured in
BPS Bits Per Second
DTE – Data Terminal Equipment (computers,
terminals)
DCE – Data Communication Equipment (modem)
Hardware Flow Control: CTS RTS
Software Flow Control: XON XOFF
getty is used to control serial ports
stty and tset are used to set terminal
options
Modems are used to send digital data across
analog telephone lines
The speed of a modem is known as its baud
rate
A breakout box can be used to debug serial
cable problems
Serial and parallel ports have mostly been
replaced by USB (Universal Serial Bus)
Chapter 32 – Management, Policy and Politics
Policies and procedures should be written
down
Account policies should be signed by the
users and consistently enforced
It is important to keep local documentation
up to date
Learning Perl
Perl was written by Larry Wall
Be prepared give the result of simple Perl
operations. Know how lists and arrays
work.
Vi Tutorial:
Know the commands to:
Delete
a character (x) line (dd) multiples (7x, 5dd) undo (u)
save
and quit (:wq) (:wq!)
insert (i) append (a) join lines (J)
search
for text (/string<CR>) duplicate
line (yyp)
leave
insert mode and return to command mode (ESC)