These classnotes are depreciated. As of 2005, I no longer teach the classes. Notes will remain online for legacy purposes

LDAP01/Overview Of Necessary UNIX Skills

Classnotes | LDAP01 | RecentChanges | Preferences

This course will be taught from Linux machines. The servers will run on Linux machines and the LDAP administration will be done on Linux machines. Thus, it is very important that the student has a certain skillset before entering into this class. This skillset can be obtained by taking UNIX01, and it can be strengthened if this course is taken concurrently with UNIX02. Before we proceed, let's review, briefly, the skills necessary for this course (if you have forgotten these skills, then I would recommend reviewing the classnotes for UNIX01):

Common UNIX Commands

File Manipulation Commands

ls
Lists a directory's contents. May be optionally followed by additional switches. (See all switches with ls --help.)

cd
Changes the current working directory.

cp
Copies one file to another.

rm
Removes (deletes) a file or files. Can be used to delete directory trees with
       rm -r directory

mkdir
Makes a directory. Can be used to make an entire directory tree with
       mkdir -p /path/to/some/directory

ln
Makes symbolic links.

File Permission Commands

chown
Changes the ownership for a file or files. The basic syntax is:
       chown [-R] user.group file or directory

chmod
Changes the permissions for a file or files. It can be passed a series of individual permission switches:
       chmod u+rwx file

or it can be passed an octal code representing permissions:
       chmod 755 file

(For more information, see UNIX01/Setting Ownership And Permissions).

Accessing Documentation

man
Most commands and programs will have an associated man page, or Manual Page. You can access them with the man command.

info
The alternative GNU Texinfo system will provide highly detailed documentation on all GNU commands. This system can be difficult to use, see UNIX01/Entering Commands II for an overview of its usage.

Text Manipulation

cat
This command will read in text from STDIN or from a file and output it back to STDOUT (or the screen). It's DOS equivalent is 'type'.

less and more
These commands view files by pages. less has more functionality in that it can scroll both forward and backward in text files, however more is better at handling "special files".

grep
Searches through text to find specific patterns requested. grep is your best friend.

Process Manipulation

ps
Lists the current running processes.

kill
Send a signal to a running process (see UNIX01/The Kill Command).

killall
Send a signal to all running processes of a given classification.

top
View top process resources.

Online Interfacing

wget or curl
These commands deal with downloading information or files from websites, ftp servers, etc. For the purposes of this class, they are equivalent and equal resources. Use whichever you feel most comfortable with.

links or lynx
These two are command-line web browsers. links is prefered as it's functionality is significantly greater than lynx, but for the purposes of this class, either one will do.

Pipes and Redirects

In case you don't remember, UNIX-like systems have a 'glue' that is used to link together diverse and independent commands. This 'glue' is known as pipes, and is absolutely fundimental to the UNIX administrator.

You can pipe the STDOUT of a given program to the STDIN of another thusly:
       program1 | program2

You can also string together long lines of commands
       cat /etc/slapd/slapd.conf | grep -i admin | ./parse.sh

In addition to standard pipes, you can redirect STDOUT (or STDERR) to a file using various redirects. For a detailed explaination, see UNIX01/Pipes And Redirects, but for a very basic situation (redirecting STDOUT to a file) you could issue:
       slapcat > ldap_backup.txt

Editing Files

You may use any editor in this class you wish. However, the following three are the most recommended:

vi or vim
The classic UNIX-standard command-line editor. Versatile and powerful, but with some esoteric commands.

emacs
The classic GNU command-line editor. Also versatile and powerful, but with some esoteric commands.

nano
The Pico-inspired editor with fairly advanced functionality and simplistic interface.

NOTE: You may have to install an editor if you do not have what you want on your system.

Debian Management

You are not required to have had any experience with Debian GNU/Linux before this course. However, Debian GNU/Linux is what we are using. If you have had UNIX or Linux experience in the past, then you will not need to relearn anything you already know of UNIX or Linux. Debian's differences are largely aesthetic ones (paths to files or configurations, desktop decorations and menu layouts, mount points and device names may all be different). We will point out these differences as we go along.

However, the one Debian item which you must learn before we proceed is the Debian package management system, apt.

apt

If you are coming from the Red Hat world (as most of you with Linux experience will be) you will be used to the RPM Package Management system and with RPM files. If you have had extensive experience with an RPM-based distro (like Red Hat, SuSE or Mandrake) you've probably experienced something called "dependency hell" where a given package you need requires a complex tree of additional packages to be installed.

Debian's package management system, apt, provides an alternative to RPM and eliminates this "dependency hell" problem when installing or upgrading packages (well, as long as you do it "official" ways, if you stray from official sources, you're on your own). apt is covered in great detail on Day 5 of UNIX02, but most of it's usage is well beyond this course.

For this class, all you need to know is that in order to install a new package, foo, you simply need to execute (as root):

 # apt-get install foo

In order to remove a package, you execute:

 # apt-get remove foo

You will also want to clear your package cache and update it regularily as new packages come out daily:

 # apt-get clean
 # apt-get update

You may also be aware of the system-wide upgrade abilities of apt using:

 # apt-get dist-upgrade

However, do not ever use that in this class. The Debian machines are set very specifically for this class, and a system-wide upgrade may make things different enough as to make them no longer sync with these classnotes.



Classnotes | LDAP01 | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited September 20, 2003 3:48 pm (diff)
Search:
(C) Copyright 2003 Samuel Hart
Creative Commons License
This work is licensed under a Creative Commons License.