Unit 1 Chapter 3
Unit 1 Chapter 3
Chapter-3
PID The process identification number, which is a unique number that is needed to manage processes.
VSZ The virtual memory size. This is the total amount of memory that is claimed by a process. It is common for
processes to claim much more memory than they actually need. This is referred to as memory over allocation.
RSS The resident memory size. This is the total amount of memory that a process is actually using.
TTY If the process is started from a terminal, the device name of the terminal is mentioned in this column.
STAT The current status of the process. The top three most common status indicators are S for sleeping, R for
running, or Z for a process that has entered the zombie state.
TIME The real time in seconds that a process has used CPU cycles since it was started.
COMMAND The name of the command file that was used to start a process. If the name of this file is between brackets, it is
a kernel process.
Sending Signals to Processes with the kill Command
The top program offers a convenient interface in which you can monitor
current process activity and also perform some basic management tasks.
Figure 3.3 shows what a top window looks like.
FIGURE 3 . 3 Showing current system activity with top
Scheduling Jobs
cron
cron cron
daemon configuration
Links is very useful to be able to access a single file from different locations.
A link appears to be a regular file, but it’s more like a pointer that exists in one
location to show you how to get to another location.
In Linux, there are two different types of links:-
• A symbolic link
• A hard link
To create a link, you need the ln command. Use the option -s to create a symbolic
link.
Without this option, you’ll automatically create a hard link. First you’ll put the
name of the original file directly after the ln command. Next you’ll specify the
name of the link you want to create.
Creating Links
1. Open a terminal, and make sure you have root permissions.
2. Use the command ln -s /etc/hosts ~/symhosts. This creates a symbolic link with
the name symhosts in your home directory.
3. Use the command ln /etc/hosts ~/hardhosts. This creates a hard link with the
name hardhosts in your home directory.
4. Use the command echo 10.0.0.10 dummyhost >> /etc/hosts. Verify that you can
see this addition in all three files: /etc/hosts, ~/symhosts, and ~/hardhosts.
5. Use the command ls -il /etc/hosts ~/symhosts ~/hardhosts. The option –I shows
the inode number. You can see that it is the same for /etc/hosts and ~/hardhosts, like
all other properties of the file.
6. Use rm /etc/hosts. Try to read the contents of ~/symhosts. What happens? Now
try to access the contents of ~/hardhosts. Do you see the difference?
7. Restore the original situation by re-creating the /etc/hosts file. You can do that
easily by making a new hard link using ln ~/hardhosts /etc/hosts.
Creating Backups
The tar command is the most common way of
creating and extracting backups on Linux.
Three major tasks are involved in using tar:
1. creating an archive,
2. verifying the contents of an archive, and
3. extracting an archive.
2. After a short while, you’ll have a tar archive in the /tmp directory.
4. Now show the contents of the archive using tar tvf /tmp/etc.tar.
5. Extract the archive in the /tmp directory using tar xvf /tmp/etc.tar.
Once finished, the extracted archive is created in the /tmp directory,
which means you’ll find the directory /tmp/etc. From there, you can
copy the fi les to any location you choose.
Managing Printers
Setting Up System Logging