Professional Documents
Culture Documents
ROLL NO: 13
CLASS: SE IT2
BATCH: B3
EXPERIMENT NO - 1
UNIX:
Initially intended for use inside the Bell System, AT&T licensed Unix to outside parties in the
late 1970s, leading to a variety of both academic and commercial Unix variants from vendors
including University of California, Berkeley (BSD), Microsoft (Xenix), Sun
Microsystems (SunOS/Solaris), HP/HPE (HP-UX), and IBM (AIX). In the early 1990s, AT&T
sold its rights in Unix to Novell, which then sold its Unix business to the Santa Cruz
Operation (SCO) in 1995 the UNIX trademark passed to The Open Group, an industry
consortium founded in 1996, which allows the use of the mark for certified operating systems
that comply with the Single UNIX Specification (SUS). However, Novell continues to own the
Unix copyrights, which the SCO Group, Inc. v. Novell, Inc. court case (2010) confirmed.
Unix systems are characterized by a modular design that is sometimes called the "Unix
philosophy". According to this philosophy, the operating system should provide a set of simple
tools, each of which performs a limited, well-defined function. A unified filesystem (the Unix
filesystem) and an inter-process communication mechanism known as "pipes" serve as the main
means of communication, and a shell scripting and command language (the Unix shell) is used to
combine the tools to perform complex workflows.
Unix distinguishes itself from its predecessors as the first portable operating system: almost the
entire operating system is written in the C programming language, which allows Unix to operate
on numerous platforms.
FEATURES
● Unix systems use a centralized operating system kernel which manages system and process
activities.
● All non-kernel software is organized into separate, kernel-managed processes.
● Unix systems are pre-emptively multitasking: multiple processes can run at the same time, or
within small time slices and nearly at the same time, and any process can be interrupted and
moved out of execution by the kernel. This is known as thread management.
● Files are stored on disk in a hierarchical file system, with a single top location throughout the
system (root, or "/"), with both files and directories, subdirectories, sub-subdirectories, and
so on below it.
● With few exceptions, devices and some types of communications between processes are
managed and visible as files or pseudo-files within the file system hierarchy. This is known
as everything is a file. However, Linus Torvalds states that this is inaccurate and may be
better rephrased as "everything is a stream of bytes".
The UNIX operating system supports the following features and capabilities:
Bell Labs, frustrated by the size and complexity of Multics but not the aims, slowly pulled out of
the project. Their last researchers to leave Multics – Ken Thompson, Dennis Ritchie, Doug
McIlroy, and Joe Ossanna among others – decided to redo the work on a much smaller scale. In
1979, Dennis Ritchie described their vision for Unix.
UNIX ARCHITECTURE
The main concept that unites all the versions of Unix is the following four basics −
● Kernel − The kernel is the heart of the operating system. It interacts with the hardware
and most of the tasks like memory management, task scheduling and file management.
A Unix kernel — the core or key components of the operating system — consists of
many kernel subsystems like process management, scheduling, file management, device
management, network management, memory management, and dealing with interrupts
from hardware devices.
The kernel provides these and other basic services: interrupt and trap handling, separation
between user and system space, system calls, scheduling, timer and clock handling, file
descriptor management.
● Shell − The shell is the utility that processes your requests. When you type in a
command at your terminal, the shell interprets the command and calls the program that
you want. The shell uses standard syntax for all commands. C Shell, Bourne Shell and
Korn Shell are the most famous shells which are available with most of the Unix
variants.
● Commands and Utilities − There are various commands and utilities which you can
make use of in your day to day activities. cp, mv, cat and grep, etc. are few examples of
commands and utilities. There are over 250 standard commands plus numerous others
provided through 3rd party software. All the commands come along with various options.
● Files and Directories − All the data of Unix is organized into files. All files are then
organized into directories. These directories are further organized into a tree-like
structure called the filesystem.
(B). INSTALLATION OF UNIX OPERATING SYSTEM
1. Download and install Virtual Box.
1)Installing VirtualBox.exe.
2)Setup VirtualBox in the required location
3)Select all options and Click on Next.
4)Click on install.
5)VirtualBox is now installing.
2. Download iso file of ubuntu
3. Installation of Ubuntu on Virtual Box
1) Open Virtual Box.
Conclusion: Hence we have successfully created case study for UNIX and Installation of UNIX
operating system
NAME: HITANSHU RAJA OZA
ROLL NO: 13
CLASS: SE IT2
BATCH: B3
EXPERIMENT NO - 2
COMMANDS:
w: The w command is a quick way to see who is logged on and what they are doing.
whoami: The whoami command is used to print the current user’s login name.
which: The which command is used to show the full path of the given executable command. Following
eg displays the location of the executable command killall.
man: The man command provides in depth information about the requested command or allows users to
search for commands related to a particular keyword. The following eg displays all information about
which command.
pwd: This command displays the current working directory.
ls: This command is used to list the details about files and directories.
history: This command will return the full history of the terminal.
echo: The echo command will return the same words as specified.
id: The id command is used to find out user id and group id of the current user or any other user.
ping: The ping command sends requests packets to the network host and reports on the response from the
remote server.
ROLL NO: 13
CLASS: SE IT2
BATCH: B3
EXPERIMENT NO - 3
3A)
AIM: Study of File manipulating commands and network commands.
OUTPUT:
1. ls:
2. wc:
3. touch:
4. cat:
5. cp:
6. mv:
7. rm:
B)NETWORKING COMMANDS
THEORY:
1)ipconfig: “ifconfig in unix”This command displays all TCP/IP network configuration values and
refreshes Dynamic Host Configuration Protocol (DHCP) and Domain Name System (DNS) settings.
2)netstat: : The netstat command displays network status and protocol statistics. It is a networking tool
used for troubleshooting and configuration that can also serve as a monitoring tool for connections over
the network.
3)ping: Tests the ability of the source component to reach the specified destination component.
4)nslookup: The nslookup command queries internet domain name servers in two modes. Interactive
mode allows you to query name servers for information about various hosts and domains, or to print a list
of the hosts in a domain. In noninteractive mode, the names and requested information are printed for a
specified host or domain.
5)nmap: Nmap is Linux command-line tool for network exploration and security auditing
OUTPUT:
1. ipconfig:
2. netstat:
3. ping:
4. nslookup:
5. nmap:
CONCLUSION: Hence we studied about file manipulating and networking commands in Unix.
3B)
AIM: Study of UNIX file system (TREE STRUCTURE).
THEORY: File system in Unix is a logical method of organizing and storing large amounts of
information in a way that makes it easy to manage. Files are organized into directories and these
directories are organized into a tree-like structure called file system. At the very top of the file system is
the root directory represented by “/”.
2. /bin: Stands for ‘binaries’. This is where the executable files are located. These files are available to all
users
4. /etc: Supervisor directory commands, configuration files, disk configuration files, valid user lists,
groups, ethernet, hosts, where to send critical messages
5. /lib: Contains shared library files and sometimes other kernel-related files
6. /home: Contains the home directory for users and other accounts
7. /mnt: Used to mount other temporary file systems, such as cdrom and floppy for the CD-ROM drive
and floppy diskette drive, respectively
8. /proc: Contains all processes marked as a file by process number or other information that is dynamic
to the system
9. /sbin: Contains binary (executable) files, usually for system administration. For example, fdisk and
ifconfig utilities
11. /usr: Used for miscellaneous purposes, and can be used by many users. Includes administrative
commands, shared files, library files, and others.
12. /usr/bin: This directory stores all binary programs distributed with the operating system not residing
in /bin, /sbin or (rarely) /etc.
THEORY: An environment variable is a value that can affect the way running process will behave on a
computer. They help programs know what directory to install files in, where to store temporary files etc.
Eg of ENVs in Unix:
$USER: Gives the current user name
$PATH: Gives path of directories for commands
$PWD: Displays path of current working directory
$HOME: Gives path of home directory
$HOSTNAME: Displays the user(host) name.
$LANG: Displays the system’s language
$EDITOR: Gives the default file editor
$UID: Displays ID of the current user
$SHELL: Displays path of user’s shell program
OUTPUT:
THEORY: Every file and directory on your Unix system is assigned to user owner, group or others.
File Permissions: Basic unix file permissions are Read, Write and Execute.
Read(r): Used to view contents of a file.
Write(w): Used to modify or remove contents of a file.
Execute(x): User with permission can run a file.
Directory Permissions: They are the same as file permissions except for a few differences.
Read: Users can read the contents. Users can look at the filenames inside the directory.
Write: Users can add or delete files from the directory.
Execute: A user must have execute access to the bin directory in order to execute the ls or the cd
command.
OUTPUT:
THEORY: vi editor is the default editor in Unix OS. We can create a new file or edit an existing file
using vi editor.
vi filename: Creates a new file if it doesnt exist, otherwise opens an existing file.
Command Mode: It is used to perform administrative tasks such as saving files, executing commands,
moving the cursor etc. To enter command mode, enter ‘Esc’ key.
Insert Mode: Used to insert text into the file. Everything that's typed in this mode is interpreted as input
and placed in the file.
vi always starts in command mode.
To exit vi editor, go to command mode and type “:wq”.This will save the content and exit the editor. “:w”
saves the content written in the file and “:q” is used to quit the editor.
OUTPUT:
1) hello world:
2) calculator:
3) even or odd:
CONCLUSION: Hence we implemented shell script programs for displaying hello world, to perform
basic calculator operations, to check if a number is even or odd using vi editor.
EXPERIMENT NO - 5
5A)
AIM: SHELL SCRIPT PROGRAM TO CHECK WHETHER GIVEN FILE IS A DIRECTORY OR
NOT.
THEORY: vi editor is used to write the script program. ‘#!/bin/bash’ will execute the program in bash
and not some other shell. ‘fi’ is used to close the if statement.
OUTPUT:
CONCLUSION: Hence we wrote a shell script program which checks if a given file is a directory or not.
5B)
AIM: SHELL SCRIPT TO COUNT NO OF FILES IN A DIRECTORY
THEORY: The easiest way to count files in a directory on Linux is to use the “ls” command and pipe it
with the “wc -l” command.
$ ls | wc -l
$ ls /filename |wc -l
In order to count files recursively on Linux, you have to use the “find” command and pipe it with the
“wc” command in order to count the number of files.
$ find <directory> -type f | wc -l
OUTPUT:
CONCLUSION: Hence we wrote a shell script program to count the number of files and directories.
5C)
AIM: Write a program using sed command
THEORY: ‘sed’ command stands for stream editor. It can be used on files to perform functions like
searching, find and replace, insertion etc. Most common use of ‘sed’ command is for substitution or for
find and replace. It also supports regular expression which allows it for pattern matching.
For substitution:
$sed ‘s/a/b/’ filename
Here: ‘s’ specifies substitution operation, ‘a’ is the word in file that is to be substituted, ‘b’ is the word
which substitutes ‘a’
OUTPUT:
i. to substitute /replace a string.
CONCLUSION: Hence we performed different programs with the help of ‘sed’ commands.