Notes: 2.3.2 Navigating in The File System

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Unit 2: Red Hat Linux 9 Basics

/mnt This is a generic mount point under which you mount your filesystems or devices. The
process by which a filesystem is made available to the system is known as mounting. After
mounting your files will be accessible under the mount-point. This directory usually contains
mount points or sub-directories where you mount your floppy and your CD. You can also
create additional mount-points here if you want. There is no limitation to creating a mountpoint anywhere on your system but convention says that you do not litter your file system with
mount-points.

Notes

/opt All the software and add-on packages that are not part of the default installation are
contained in this directory. Generally you will find KDE and StarOffice here. Again, this directory
is not used very often as its mostly a standard in Unix installations.
/proc This is a special directory on your system.
/root This is the home directory of the user root. This is not to be confused with the system
root, which is directory at the highest level in the filesystem.
/tmp The files that are required temporarily are included in this directory. Many programs
use this to create lock files and for temporary storage of data. On some systems, this directory is
cleared out at boot or at shutdown.
/usr - This directory contains all the user binaries. X and its supporting libraries can be found
here. User programs like telnet, ftp etc. are also placed here. /usr/doc contains useful system
documentation. /usr/src/linux contains the source code for the Linux kernel.
/var - This directory includes spooling data such as mail and also the output from the printer
daemon. Also, the system logs are also kept here in /var/log/messages. You will also find the
database for BIND in /var/named and for NIS in /var/yp.

2.3.2 Navigating in the File System


We can navigate the file system by means of either a GUI file explorer (for example, Nautilus)
or the terminal.

Navigating Using the GUI


To begin the GUI file explorer, it is required to execute the Nautilus file manager. In order to
start Nautilus in a quick way, we can choose it from the menu. That is, by selecting Main Menu
Home Folder. This will provide the Nautilus file manager, which looks like the Windows
Explorer of Microsoft. When the Nautilus file manager is opened in this manner, then the
directory displayed in the location bar is your home directory.
Figure 2.11: Home Directory

LOVELY PROFESSIONAL UNIVERSITY

29

Operating System Tools

Notes

Now, we can type any location into the location bar. The contents will be displayed at that
location. On the other hand, we can select the button marked Up in order to make Nautilus show
the contents of the parent directory instead. Thus, we can navigate the whole way up to the root
directory (/ ). All the top-level directories of the computer can be found in the root directory. In
order to navigate inside the directories, simply doubleclick on the directories.
Generally, the file system navigation by means of the file manager is very intuitive. If you are
familiar with an operating system based on GUI, then you will see yourself right at home with
Nautilus.

Navigating Using the Terminal Emulator


When we open a terminal emulator window, it places us at the shell prompt, and in our home
directory. The shell is defined as the program which interprets every command that we type at
the terminal.
The directory in which we are located at any specific time is known as the current directory. When
we open up the terminal first time, then the current directory is set to be the home directory. We
can find out the directory at any time by executing the pwd command.
Example: The command pwd:$ pwd /home/sandipb signifies that the pwd program is
being utilized to confirm that the current directory just after opening the terminal application is
the home directory of the user.

Self Assessment
Fill in the blanks:
5.

....................................... makes a file or directory visible in multiple parts of the systems file
tree.

6.

....................................... directory contains all the binaries that are essential to the working of
the system.

2.4 Managing the Hardware


The installation process of Red Hat Linux automatically attempts to identify the existing hardware
and configure it so as to make use of it in the desktop. At times, this hardware configuration is
required to be fine-tuned, or the auto-detection of hardware at some stage in the installation process
does not function as intended. In these type of cases it is essential to know the process of adjusting
the desktops hardware configuration manually.

2.4.1 Detecting the Available Hardware


The present major hardware configuration can be determined by means of the hardware browser.
In order to launch the hardware browser, choose Main Menu System Tools Hardware
Browser. Alternatively, type hwbrowser at a command line. The function of hardware browser is
to look for the hardware on the system and show the results. This is shown as below:
We can collect more information regarding the hardware by working from the terminal itself. In
this section, we will also discuss how to gather information regarding the system by means of
the CLI. The main areas that we will consider for investigation are as follows:

30

LOVELY PROFESSIONAL UNIVERSITY

Unit 2: Red Hat Linux 9 Basics

Figure 2.12: Finding the Available Hardware

Notes

Source: http://flylib.com/books/en/1.65.1.26/1/

Area

Description

CPU

The type of CPU and the amount of processing load.

Memory

The amount of memory installed on the system and its usage


pattern.

Hard disk, CD-ROM, and


floppy drives

The disk capacities and their usage status.

Network cards

The network devices which are operational and their usage


statistics.

Mouse

The kind of mouse being used by the system.

Keyboard

The kind of keyboard being used by the system.

Display

The display card detected by the system and its current usage status.

Various PCI and USB


devices

The various devices detected by the system.

Sound

The sound card detected and used by the system.

Operating system maintains some special files in a dynamic manner. A lot of information can
be found by using these special files. These files are located in the /proc directory. We call these
files special as operating system generates them on demand. Also, these files are not actually
available on the file system except when requested (for instance, by the ls /proc command).
The cat command can be used to view the contents of these files. On the other hand, we can make
use of a text editor like gedit.

CPU-related Information
We can find out the CPU information discovered by the operating system by displaying the
contents of the file /proc/cpuinfo. This is displayed as below:

LOVELY PROFESSIONAL UNIVERSITY

31

Operating System Tools

Notes

Figure 2.13: The CPU Information

Source: http://flylib.com/books/en/1.65.1.26/1/

The value of bogomips specified at the bottom of the display is an approximate calculation of
the processors speed. We can use this figure to get an approximate comparison of the relative
speeds of two different computers running different processors.
The usage of CPU can be found in various ways. There is a graphical tool known as the System
Monitor. We can launch system monitor by choosing Main Menu System Tools System
Monitor. In this application, the System Monitor tab displays the usage of CPU over time in a
graphical format which is shown as below:
Figure 2.14: System Monitor Tab

Source: http://flylib.com/books/en/1.65.1.27/1/

Besides the CPU usage information, the System Monitor tab also gives information on memory
usage and mounted file systems.

32

LOVELY PROFESSIONAL UNIVERSITY

Unit 2: Red Hat Linux 9 Basics

Notes

Notes Actually, Swap memory is not a memory in the conventional sense. It is a disk space
which is used by the operating system in order to store information for the time being.

The Use of Load Average to Measure CPU Usage


The CPU usage, in case of Linux as well as other UNIX-based operating systems, is frequently
assessed in terms of load average. We can display Load average by making use of three numerical
values. The load average is defined as the average number of processes which are waiting to be
executed system over a specified time interval. The load average can be examined in different
manners.
Example: We can examine the contents of the file /proc/loadavg.
Here, the first three figures (0.44, 0.29, 0.17) depict the systems load average taken over the last
one, five, and fifteen minutes.
The output of this program also displays the total time for which the computer has been running.
The top program can be executed. This program displays a wealth of information. Also, the
display updates itself in every few seconds.
Note that the first part depicts the load average of the system, and the usage of memory in the
system. The remaining display demonstrates the processes running on the system, together with
a wealth of information on every process.
This output allows you to change many properties of the display and even to destroy processes.
In order to exit the top display, it is required to press q on the keyboard.

Memory-related Information
To determine information regarding the total amount of RAM in the system and the amount of
swap memory, we can look at the System Monitor dialog. Another quick option for determining
the status of RAM and swap is to display the contents of the file /proc/meminfo. This is shown
as below:
Figure 2.15: Example of Command /proc/meminfo

Source: http://superuser.com/questions/521551/cat-proc-meminfo-what-do-all-those-numbers-mean

We can also examine the usage of memory via the System Monitor or the top program.

LOVELY PROFESSIONAL UNIVERSITY

33

Operating System Tools

Notes

Information Regarding the File System Devices


We can use System monitors graphical interface to locate information on the mounted file
system in the computer. On the other hand, there is also a fast CLI-based method to find similar
information, and this requires the df program. We have shown below the usage of the df program:
Figure 2.16: df Program Usage

Source: http://flylib.com/books/en/1.65.1.26/1/

In the figure shown above, the -h option shows the output in a more readable format.
If using a hard disk with multiple partitions as well as multiple operating systems, it is useful to
be able to check the hard disks partition structure and the different partition types obtainable on
it. We can show this by using the fdisk program, with the 1 option.
The superuser mode is showed by the change in the prompt. That is, the last character of the
prompt changes from a $ sign to a # sign.
The l option is utilized to query the hard disk structure, and is quite safe. On the other hand,
other fdisk options manipulates your hard disk partitions, and erroneous usage of these options
can demolish the data of hard disk.

Caution It is essential to make use of the fdisk program only with care.

Network Cards
As a Linux user you should know about some network properties like network card name,
speeds, driver details etc. Here we will discuss the same with help of examples.
Example 1: Find all your network cards (Ethernet, Gigabit Ethernet, Wireless) names attached to
a given system.
Command
ifconfig | cut -c1-8 | sort -u
Output
eth0
lo
virbr0
wlan0
Example 2 : find how many network connections(network cables are connected to your machine)
are active i.e. link is up.
Command
ip link show

34

LOVELY PROFESSIONAL UNIVERSITY

You might also like