Linux/Unix Introduction
Lets Understand



Linux/Unix Introduction:1
• Linux is a modern, flexible, and mature operating system. Although it started life on the Intel platform, it has since been ported to many other platforms such as Amiga, DEC Alpha, Apple Power PC, Sun workstations, and others. • Linux boasts many other features: • Multitasking - Linux is a true preemptive multitasking operating system. All processes run independently of each other and leave processor management to the kernel. • Networking - Linux supports a multitude of networking protocols. • Interoperability - Linux can interoperate with Windows 9x/NT/NT 2000, Novell, Mac, and most other versions of UNIX. • Multi-user - Linux can handle multiple users simultaneously logged on to one machine. • Advanced memory management Traditional UNIX systems used swapping to manage memory, where the entire memory structure of a program was written to disk when the system began running low on memory. Linux uses paging, a method that intelligently allocates memory, when system memory is running low, by prioritizing memory task pictesolutions 2

including DOS/Windows. pictesolutions 3 . Multiple file systems Linux must be installed on Extended 2 Linuxformatted partitions.Linux/Unix Introduction:2 • • Linux currently supports up to 64GB of RAM. This is just another interoperability feature provided by Linux. OS/2. and Novell. Linux will support several of these file system formats as well. but if certain other OS file systems already exist on the same host.

Overview of Linux/Unix File System Hierarchy Standard (FHS) Unix/Linux Architecture pictesolutions 4 .2.

but the two most important are compatibility with other compliant systems and the ability to mount a /usr/ partition as read-only because it contains common executables and should not be changed by users. • The FHS document is the authoritative reference to any FHScompliant file system.FHS • Red Hat is committed to the Filesystem Hierarchy Standard (FHS). a collaborative document that defines the names and locations of many files and directories. Since the /usr/ directory is mounted read-only. This section is an overview of the standard and a description of the parts of the file system not covered by the standard. • Compliance with the standard means many things. but the standard leaves many areas undefined or extensible. it can be mounted from the CD-ROM or from another machine via a readpictesolutions only NFS mount 5 .

These files are essential for the system to function properly. Below are some important files which resides under /etc/ directory: /etc/passwd :.FHS Organization • The directories and files noted here are small subsets of those specified by the FHS document. Refer to the latest FHS document for the most complete information. The /dev/ Directory The /dev/ directory contains file system entries which represent devices that are attached to the system. 6 • • • • • • • pictesolutions . The /etc/ Directory The /etc/ directory is reserved for configuration files that are local to the machine.contains all the local user’s information /etc/system :.it is a system configuration file which helps to boot the server.

All the third party software/application will be installed under this directory. The /opt/ Directory The /opt/ directory provides storage for large. such as CD-ROMs and fioppy disks. static application software packages. These shared library images are particularly important for booting the system and executing commands within the root file system.FHS Organization • • The /lib/ Directory The /lib/ directory should contain only those libraries that are needed to execute the binaries in /bin/ and /sbin/. The /mnt/ Directory The /mnt/ directory is for temporarily mounted file systems. • • • • pictesolutions 7 .

Standard directories – the system administration utility files – most commonly used UNIX commands /etc /bin /usr /dev /lib /tmp – System related files – all device files – library files for C compiler – temporary storage / etc bin pictesolutions usr dev lib tmp 8 .

FHS Organization • The /proc/ Directory • The /proc/ directory contains special files that either extract information from or send information to the kernel. • Local-only system administration binaries should be placed into /usr/local/sbin. Due to the great variety of data available within /proc/ and the many ways this directory can be used to communicate with the kernel • The /sbin/ Directory • The /sbin/ directory is for executables used only by the root user." pictesolutions 9 .

variable data files. administrative and logging data. This includes spool directories and files. and transient and temporary files.FHS Organization • • The /var/ Directory The FHS states /var/ is for: "." pictesolutions 10 ...

Lock files go in the /var/lock/ directory.FHS Organization • System log files such as messages/ and lastlog/ go in the /var/log/ directory. usually in directories particular for the program using the file. The /var/spool/ directory has subdirectories for various systems that need to store data files pictesolutions 11 . The /var/lib/rpm/ directory also contains the RPM system databases.

it is still possible to install a package or program under the /usr/local/ directory. pictesolutions 12 . • For instance.FHS Organization /usr/local/ in Red Hat Linux • In Red Hat Linux. The FHS says that /usr/local/ should be where software that is to remain safe from system software upgrades is stored. the /usr/local/ directory is used for software that is local to the machine. if the /usr/ directory is mounted as a read-only NFS share from a remote host. Instead. Since system upgrades from under Red Hat Linux performed safely with the rpm command and graphical Package Management Tool application. the intended use for the /usr/local/ directory is slightly different from that specified by the FHS. it is not necessary to protect files by putting them in /usr/local/.

Most files pertaining to the Red Hat Package Manager (RPM) are kept in the /var/lib/rpm/ directory. including RPM header information for the system. one more directory worth noting is the /initrd/ directory. The /var/spool/up2date/ directory contains files used by Red Hat Update Agent. 13 pictesolutions . Another location specific to Red Hat Linux is the /etc/sysconfig/ directory.File Locations • • Special File Locations Red Hat Linux extends the FHS structure slightly to accommodate special files. This directory stores a variety of configuration information. It is empty. but is used as a critical mount point during the boot process • • . Finally. This location may also be used to temporarily store RPMs downloaded while updating the system. Many scripts that run at boot time use the files in this directory.

The information here is not intended to be complete. pictesolutions 14 . as many of these files have a variety of options that are only used in very specific or rare circumstances . Here we will outline some of the files found in the /etc/sysconfig/ directory.File Locations • • The sysconfig Directory The /etc/sysconfig/ directory is where a variety of system configuration files for Red Hat Linux are stored.

cipe |.desktop |.dhcpd |.authconfig |.apmd |.arpwatch |.i18n 15 pictesolutions .amd |.clock |.harddisks |.gpm |.hwconf |.File Locations • • • • • • • • • • • • • • • Files in the /etc/sysconfig/ Directory The following files are normally found in the /etc/sysconfig/ directory: |.firstboot |.

netdump |.irda |.pcmcia |.ipchains |.init |.network |.identd |.rawdevices 16 pictesolutions .ntpd |.mouse |.named |.keyboard |.radvd |.File Locations • • • • • • • • • • • • • • • |.kudzu |.iptables |.

ups |.xinetd Note: If some of the files listed are not present in the /etc/sysconfig/ directory.spamassassin |.vncservers |.redhat-config-securitylevel |.squid |.redhat-config-users |.redhat-logviewer |.tux |.File Locations • • • • • • • • • • • • • |.soundcard |. then the corresponding program may not be installed. 17 pictesolutions .sendmail |.samba |.

3. Linux/Unix Resource Monitoring pictesolutions 18 .

While there are more than those listed here. free The free command displays system memory utilization.Resource Monitoring • • Resource Monitoring Commands Red Hat Linux comes with a variety of resource monitoring tools. these tools are representative in terms of functionality. a more graphically oriented version of top) vmstat The sysstat suite of resource monitoring tools Let us look at each one in more detail. The tools are: top (and GNOME System Monitor. • • • • • • pictesolutions 19 .

load average. the top command does a little bit of everything. there is no need to use the watch command. The top section contains information related to overall system status —uptime. and utilization statistics for both memory and swap space. • The display is divided into two sections. process statistics. CPU utilization. pictesolutions 20 . unlike the free command. CPU status. In addition. top's default behavior is to run continuously. process counts.Resource Monitoring • top • While free displays only memory-related information. memory utilization — top does it all. The lower section displays process-level statistics. the exact nature of which can be controlled while top is running.

swap.Resource Monitoring • • vmstat For a more concise view of system performance. memory. it is possible to get an overview of process. I/O. try vmstat. Using this resource monitor. and CPU activity in one line of numbers: pictesolutions 21 . system.

Resource Monitoring • • pstree Gives a hierarchical structure of all currently running processs: pictesolutions 22 .