OS Lab Manual Lab5 &6
OS Lab Manual Lab5 &6
Lab Activities:
What is Linux?
Linux kernel
The Linux kernel is an operating system kernel used by the Linux family of Unix-
like systems. It is one of the most prominent examples of free and open source software
Booting:
In computing, booting (also known as booting up) is a process that begins when a user turns on
a computer system and prepares the computer to perform its normal operations. On modern
computers, this typically involves loading and starting an operating system. The boot sequence is
the initial set of operations that the computer performs when power is switched on. A boot loader
is a computer program that typically loads the main operating system or runtime environment for
the computer after completion of a power-on self-test.
3- Installation
Dual Boot
1. Partitions
2. Root boot swap
3. File formats
4. Free some space on your hard disk for installing Linux and delete it. Now when Linux
installation will run you will have to select this unpartitioned area for your Linux
installation.
5. Perform media check on Linux installation CDs to confirm the integrity of the installing
media.
6. There are two modes of installation
a. Texture Interface for professionals
b. Graphical User Interface for novice people
i. It is recommended to select the latter option.
7. At the time of partitioning, you will be prompted to select ‘manual partitioning’ or
‘automatic partitioning’. Automatic partitioning is recommended for new users.
8. For running NS-2 or some other development tools later in Linux, it is recommended to
install all development packages at the time of installation. Otherwise you can install
them later just like ‘add/remove window components’ in windows.
9. Select the ‘Boot from CD option’ and start installation..
10. To help you during the installation procedure, some tips are normally provided on the left
top corner of the screen.
Virtual Machine
Minidisks
1. Copy image of fedora in any drive of your computer.
2. Install virtual box software and just follow the next instruction
3. Give path of image of fedora in the desired tab and click next
4. It will start installation
Lab Exercises
(Note: All Lab exercises must be submitted in hand written form)
Answers
1. Linux File System:
Linux primarily uses the ext4 (Fourth Extended File System) as its default file system. However,
there are other file systems like ext3, Btrfs, XFS, and more, depending on specific use cases and
distributions.
2. Boot Loaders:
GRUB (GRand Unified Bootloader): It is the default bootloader for most Linux distributions.
GRUB allows users to choose which operating system to boot into and provides advanced
configuration options.
LILO (LInux LOader): Though less common now, LILO was widely used in the past. It is a
straightforward bootloader with less flexibility compared to GRUB.
3. Linux Partitions:
Linux uses various partitions to organize data on a storage device. Some commonly used
partitions include:
Root Partition (/): It contains the core system files and directories. It is the top-level directory in
the file system hierarchy.
Swap Partition: Linux uses this partition for virtual memory, especially when the physical
RAM is full.
Home Partition (/home): It stores user-specific data, configurations, and personal files.
4. Why Use Linux:
Open Source: Linux is free and open-source, promoting collaboration and customization.
Stability: Linux systems are known for their stability and reliability, often used in critical
environments.
Security: Linux has a robust security model, and its open nature allows quick responses to
vulnerabilities.
Customization: Users have the freedom to tailor the system to their specific needs.
Performance: Linux is efficient and can run on a wide range of hardware, from embedded
systems to supercomputers.
Cost-Effective: Linux is free to use, reducing software costs for businesses and individuals.
Security: With a strong permission system and regular updates, Linux is considered more secure
than some other operating systems.
Flexibility: Linux supports a wide range of hardware and offers multiple desktop environments,
providing users with flexibility.
Community Support: The Linux community is vast, providing support, forums, and a wealth of
documentation.
Reliability: Linux systems are known for their stability and can run for extended periods without
needing a reboot.
______________________________________________________________________________
LAB 6
Lab 6
Lab Objective: This lab introduces few of the basic commands of Linux.
Lab Activities:
Getting Started with Linux
The login prompt may be graphical or simple text
If text, logging in will present a shell
If graphical, logging in will present a desktop
1. Some combination of mouse and keystrokes will make a terminal window
appear
2. A shell runs in the terminal window
Linux Command Line
1. The shell is where commands are invoked
2. A command is typed at a shell prompt
a. Prompt usually ends in a dollar sign ($)
3. After typing a command press Enter to invoke it
a. The shell will try to obey the command
b. Another prompt will appear
4. Example:
a. $ date
b. Sat March 01 11:59:05 BST 2008
c. $
d. The dollar represents the prompt in this course, do not type it
Logging Out
1. To exit from the shell, use the exit command
2. Pressing Ctrl+D at the shell prompt will also quit the shell
a. Quitting all programs should log you out
b. If in a text-only single-shell environment, exiting the shell should be sufficient
3. In a window environment, the window manager should have a log out command for this
purpose
4. After logging out, a new login prompt should be displayed
Command Syntax
1. Most commands take parameters
6. Usually lower-case
$ echo whisper
whisper
$ ECHO SHOUT
bash: ECHO: command not found
Files
1. Data can be stored in a file
2. Each file has a filename
$ cat >shopping_list
cucumber
bread
yoghurts
fish fingers
3. Note the greater-than sign (>) — this is necessary to create the file
4. The text typed is written to a file with the specified name
5. Press Ctrl+D after a line-break to denote the end of the file
1. The next shell prompt is displayed
6. ls demonstrates the existence of the new file
Displaying Files’ Contents with cat
1. There are many ways of viewing the contents of a file
2. One of the simplest is with the cat command:
1. $ cat shopping_list
2. cucumber
3. bread
4. yoghurts
5. fish fingers
3. Note that no greater-than sign is used
4. The text in the file is displayed immediately:
1. Starting on the line after the command
2. Before the next shell prompt
Filename Completion
13. The shell can making typing filenames easier
14. Once an unambiguous prefix has been typed, pressing Tab will automatically ‘type’ the
rest
15. For example, after typing this:
1. $ rmsho
2. Pressing Tab may turn it into this:
3. $ rmshopping_list
16. This also works with command names
Q1
20. Log in. Open a terminal window, to start a shell.
21. Exit from the shell; the terminal window will close.
22. Start another shell. Enter each of the following commands in turn.
1. date
2. whoami
3. hostname
4. uname
5. uptime
Q2
1. Use the ls command to see if you have any files.