For systems administration a good knowledge of the superuser account is very important 1. Most of the tasks that you will need to carry out need will require its use.
![]() |
|
Next try to actually use your superuser privileges. Try the following commands using the superuser account. Most of them will not work without.
![]() |
|
Now, back to some shell commands!
There are lots of Unix commands that appear to do very little on their own. Combining these together using pipes and redirects is one of the things that makes Unix so useful. Having a good understanding of these can make you quicker and more productive than the traditional GUI 2.
![]() |
Briefly describe the following commands:
|
Next, you will need some external resources.
![]() |
In your home directory, run the command
You should be able to unpack this as a directory structure in your home directory. |
![]() |
|
Linux has a system of file and directory permissions. Personally, I find it more straight-forward than Windows bizarre set of options and conditions. However, Unix file permissions catch everyone out at times and can be confusing. It's important that you understand them.
![]() |
|
Unix offers a wide range of possibilities for scripting. At it's simplest, this involves writing a set of commands into a file and having them run one after the other.
There are many different scripting languages available on a Linux system. They are generally all fairly powerful, but they all have their quirks and differences 4. In this course, we will introduce you to the facilities provided by the shell (bash) that you are using. All of these facilities are actually available at the command line or can be placed within a file.
While some fairly large applications have been written using bash
scripts, it's generally not a good idea. As a language, it's
functional, but not straight-forward. It can be hard to
debug. However, it will run on almost every unix system
everywhere. Other languages commonly used for system administration,
include tcl
, perl
, python
and awk
. Generally, I use bash if it's
simple (< 50 lines), perl
if it's more complicated (< 1000
lines). More than this, I write an application in Java. This is a personal
choice though; others do it differently.
Scripts need to be in a file with executable privileges. If you wish
to execute the script aScript
in the current directory you must give
an explicit path, ie ./aScript
. Scripts normally start with the
"magic shebang line". This just tells unix which command to use to run
the script.
#!/bin/bash echo "hello world!" echo "your home directory is $HOME"
![]() |
|
1. Being a system admin gives some people an unwholesome feeling of power; they can do things like switch peoples network connection on and off, remove all their files and so on. Please don't. A nice sys-admin who only says "no" when they really have to is worth their weight in gold.
2. I do most of my file management with these commands on both Unix and Windows (using Cygwin). The file manager does have it's use, but this is generally quicker.
3. find
is one of those commands which really does too much. The man
pages on my version are over 900 lines long which is really
excessive. Some Unix commands are like this. You don't, however,
need to know all the options of a command for it to be very
useful. Very few people actually know all the options. They just
read the man pages when they need them.
4. Again choice of scripting languages is a bit religious. I don't understand why these things cause such passion, but they do.