OS Lab File
OS Lab File
OS Lab File
DEPARTMENT OF INFORMATION
TECHNOLOGY
Practical File
1902629 Page 1
Department of InformationTechnology
Sr no. Task Page no.
1 Introduction to Operating system and case study 3 to 11
on DOS,LINUX and WINDOWS operating
system.
1902629 Page 2
Department of InformationTechnology
Task NO:- 1
TITLE:- Introduction to Operating system and case study on DOS,LINUX and
WINDOWS operating system.
OBJECTIVE:-
• To study different types of operating system.
• To study DOS, LINUX and WINDOWS operating system.
• To do comparison between DOS, LINUX and WINDOWS operating system.
THEORY:-
1 To study different types of operating system:-
Operating system:- An operating system (OS) is a collection of software that manages
computer hardware resources and provides common services for computer programs. The
operating system is a vital component of the system software in a computer system.
Batch operating system:- The users of a batch operating system do not interact with the
computer directly. Each user prepares his job on an off-line device like punch cards and
submits it to the computer operator. To speed up processing, jobs with similar needs
1902629 Page 3
Department of InformationTechnology
are batched together and run as a group. The programmers leave their programs with the
operator and the operator then sorts the programs with similar requirements into batches.
Time-sharing operating systems:- Time-sharing is a technique which enables many
people, located at various terminals, to use a particular computer system at the same time.
Time-sharing or multitasking is a logical extension of multiprogramming. Processor's time
which is shared among multiple users simultaneously is termed as time-sharing.
Distributed operating System:- Distributed systems use multiple central processors to
serve multiple real-time applications and multiple users. Data processing jobs are distributed
among the processors accordingly.
Network operating System:- A Network Operating System runs on a server and
provides the server the capability to manage data, users, groups, security, applications, and
other networking functions. The primary purpose of the network operating system is to allow
shared file and printer access among multiple computers in a network, typically a local area
network (LAN), a private network or to other networks.
Real Time operating System:- A real-time system is defined as a data processing
system in which the time interval required to process and respond to inputs is so small that it
controls the environment. The time taken by the system to respond to an input and display of
required updated information is termed as the response time. So in this method, the response
time is very less as compared to online processing.
2 To study DOS, LINUX and WINDOWS operating system.:-
Disk Operating System (in detail):- A disk operating system (abbreviated DOS) is a
computer operating system that resides on and can use a disk storage device, such as a floppy
disk, hard disk drive, or optical disc. A disk operating system must provide a file system for
organizing, reading, and writing files on the storage disk. Strictly speaking, this definition
does not apply to current generations of operating systems, such as versions of Microsoft
Windows in use, and is more appropriately used only for older generations of operating
systems.
1902629 Page 4
Department of InformationTechnology
Commands : These are in built commands of MS-DOS i.e. these are stored in
Command interpreter file (COMMAND.COM). These commands reside in the
memory as long as the machine is at he system prompt(C:\>) level. To use these
commands no extra /external file is required. E.g. DATE, TIME, DIR, VER etc. (b)
External commands : These are separate program (.com) files that reside in DOS
directory and when executed behave like commands. An external command has
predefined syntax. for e.g. HELP, DOSKEY, BACKUP, RESTORE, FORMAT
etc.
Types of DOS commands
Any instruction given to the computer to perform a specific task is called command. The
DOS has several commands, each for a particular task and these are stored in DOS directory
on the disk. The commands are of two types : (a)Internal Commands : These are in built
commands of MS-DOS i.e. these are stored in Command interpreter file
(COMMAND.COM). These commands reside in the memory as long as the machine is at he
system prompt(C:\>) level. To use these commands no extra /external file is required. E.g.
DATE, TIME, DIR, VER etc. (b) External commands : These are separate program (.com)
files that reside in DOS directory and when executed behave like commands. An external
command has predefined syntax. for e.g. HELP, DOSKEY, BACKUP, RESTORE,
FORMAT etc.
Windows OS (in detail):- WINDOWS was similar to APPLE Mach operating system
interface on IBM-PC. The main features of windows are easy to use graphical user interface
(GUI), device independent graphics and multitasking support. The first version of
windows1.0 was introduced in 1985. Windows was an application of MS-DOS using the
basic commands of DOS. Windows for Workgroup (WIN3.11) released in 1992 was an
integrated windows and networking package with file and printer sharing capabilities, a
network mail (Microsoft Mail) and a workgroup scheduler (Schedule+) packages in windows
environment. WINDOWS-95 released in 1995 is a 32-bit operating system which includes
MS-DOS7.0 and takes control of computer system after starting.
1902629 Page 5
Department of InformationTechnology
• Windows 95 and its applications run under the PCs protected mode, which mean that
one ill behaved program cannot compromise the memory and resources of another.
This approach adds a large measure of reliability to the total operating environment.
The crash of a single errant program does not automatically crash the operating
system or any of other programs that your running.
• Windows 95 is a pre-emptive multitasking means that programs running in the
background do not significantly degrade the interactive program that you are running
in the foreground e.g. you can comfortably type into word processors while your
database system backs up all its files. Under Windows 3.1 the typed key displays
lagged behind while the backup procedure logged the processor.
• Windows 95 integrates virtually all of your computing tasks and resources like
networks, E-mail, multimedia, system administration, printing, faxing, applications
into one common user interface.
1902629 Page 6
Department of InformationTechnology
LINUX (in detail):- Linux is one of popular version of UNIX operating System. It is
open source as its source code is freely available. It is free to use. Linux was designed
considering UNIX compatibility. Its functionality list is quite similar to that of UNIX.
1902629 Page 7
Department of InformationTechnology
Interface DOS uses a command line or Text Windows has Graphical User
based interface. Interface (GUI) and a Command
Line Interface.
Framework Disk operating system runs on disk Windows operating system runs
storage devices such as hard disk on GUI for providing more
interactive,
1902629 Page 8
Department of InformationTechnology
drive or floppy disk for executing intuitive and user-friendly
commands. interface.
Windows LIMUX
1902629 Page 9
Department of InformationTechnology
Alpha, MIPS, V, s390, SuperH, NDS32, Nios II, OpenRISC,
PowerP C. SPARC, ARC Unicore32, x86, Xtensa, ARM, C6x.
Ease of Windows has a rich It is mostly used by technical people because you
use GUI and can be should know various Linux commands to be able to
easily used by work with Linux OS. For an average user, it will
technical as well as require significant time to learn Linux. Also, the
non-technical troubleshooting process on Linux is complicated than
persons. It is very on Windows.
simple and user
friendly.
Disk operating system runs It is mostly used by technical people because you should
on disk storage devices know various Linux commands to be able to work with
such as hard disk drive or Linux OS. For an average user, it will require significant
floppy disk for executing time to learn Linux. Also, the troubleshooting process on
commands. Linux is complicated than on Windows.
As a command line OS, Monolithic kernel (whole operating system works in the
users need to type the kernel space).
commands manually to
give instructions to the
system.
1902629 Page 10
Department of InformationTechnology
ROM-DOS, OpenDOS, RISC, PowerPC, RISC-V, s390, SuperH, NDS32, Nios
Novell DOS etc. II, OpenRISC, SPARC, ARC Unicore32, x86, Xtensa,
ARM, C6x.
1902629 Page 11
Department of InformationTechnology
Task NO:- 2
Procedure:-
STEP 1:- Insert the ID in the drive and boot the computer from CD. First of all, the user will
be prompted to select the language to select English or any other language according to users
performance.
STEP 2:- Now the user will be open to Menu user can choose try Ubuntu without installing
option to try Ubuntu without actually installing it on the user hardware drive for installing
you want to choose the second option download Ubuntu.
1902629 Page 12
Department of InformationTechnology
STEP 3:- Open to start now initialize and after few minutes user can use the installation
window step four clip forward and it will check the minimum requirement for running
Ubuntu on uses PC if everything is fine music and sea green colored tick marks user can also
select the download update while installing and install some third-party software after
selecting the things user want to click forward.
1902629 Page 13
Department of InformationTechnology
STEP 4:- Now user can choose either erase and use entire disk option or specify party mint
manually option user can choose the first option. User can choose the first option if you just
bought Linux to exist in users system as select second option now it will display the free
space available for users PC.
Free space and click on add option to create a new partition and choose partition type as
primary size around 70% of the free space available or choose anything like 1000 or 2000
MB used as extra general file system and selecting point.
1902629 Page 14
Department of InformationTechnology
Now again select free space from the table and click add option now select size to be around
300 MB use it as extracting journaling file system and select mount point as boot.
Now games next 20 days from the table and click adoption now select size to be around twice
the size of users Ram that is around 1000 MB if users RAM size is 512 MB and select used
as a swap area and take on.
1902629 Page 15
Department of InformationTechnology
STEP 5:- Click install new button and then visit will ask users location select users location
and click forward.
1902629 Page 16
Department of InformationTechnology
STEP 6:- while user are selected these optimize wizard will continue to copy files now select
users deserved keyboard and click forward.
STEP 7:- Now fill the details about the user, name, computer name, the username and create
a password and click forward and let Ubuntu copy all the essential files.
1902629 Page 17
Department of InformationTechnology
STEP 8:- After all files have been explained and installed 12 will display a message saying
that installation complete and click on restart button to restart your computer remove the CD
from the CD Drive.
Step 9:- After restarting user PC wait for the ubuntu to load and then it will display the login
screen. Choose the user and enter password and click login.
1902629 Page 18
Department of InformationTechnology
Task NO:- 3
FCFS scheduling :-First Come First Serve (FCFS) is an operating system scheduling
algorithm that automatically executes queued requests and processes in order of their arrival.
It is the easiest and simplest CPU scheduling algorithm. In this type of algorithm, processes
which requests the CPU first get the CPU allocation first. This is managed with a FIFO
queue. The full form of FCFS is First Come First Serve.
Code:-
#include<stdio.h>
#include<conio.h>
void main()
char pn[10][10];
int arr[10],bur[10],star[10],finish[10],tat[10],wt[10],i,n;
int totwt=0,tottat=0;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%s%d%d",&pn[i],&arr[i],&bur[i]);
1902629 Page 19
Department of InformationTechnology
for(i=0;i<n;i++)
if(i==0)
star[i]=arr[i];
wt[i]=star[i]-arr[i];
finish[i]=star[i]+bur[i];
tat[i]=finish[i]-arr[i];
else
star[i]=finish[i-1];
wt[i]=star[i]-arr[i];
finish[i]=star[i]+bur[i];
tat[i]=finish[i]-arr[i];
for(i=0;i<n;i++)
printf("\n%s\t%6d\t\t%6d\t%6d\t%6d\t%6d",pn[i],arr[i],bur[i],star[i],tat[i],finish[i]);
totwt+=wt[i];
tottat+=tat[i];
1902629 Page 20
Department of InformationTechnology
getch();
Output:-
19026
29 Page 21
Department of InformationTechnology
Task NO:- 4
TITLE:- Implementation of SJF scheduling algorithms to find turnaround time and waiting
Time.
Theory:-
SJF scheduling:- It is an algorithm in which the process having the smallest execution
time is chosen for the next execution. This scheduling method can be preemptive or non
preemptive. It significantly reduces the average waiting time for other processes awaiting
execution. The full form of SJF is Shortest Job First.
1 Preemptive:- In Preemptive SJF Scheduling, jobs are put into the ready queue as they
come. A process with shortest burst time begins execution. If a process with even a shorter
burst time arrives, the current process is removed or preempted from execution, and the
shorter job is allocated CPU cycle.
Code:-
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
int et[20],at[10],n,i,j,temp,st[10],ft[10],wt[10],ta[10];
int totwt=0,totta=0;
float awt,ata;
1902629 Page 22
Department of InformationTechnology
char pn[10][10],t[10];
scanf("%d",&n);
for(i=0;i<n;i++)
for(i=0;i<n;i++)
for(j=0;j<n;j++)
if(et[i]<et[j])
temp=at[i];
at[i]=at[j];
at[j]=temp;
temp=et[i];
et[i]=et[j];
et[j]=temp;
strcpy(t,pn[i]);
strcpy(pn[i],pn[j]);
strcpy(pn[j],t);
}}
1902629 Page 23
Department of InformationTechnology
for(i=0;i<n;i++)
if(i==0) st[i]=at[i];
else st[i]=ft[i-1];
wt[i]=st[i]-at[i];
ft[i]=st[i]+et[i];
ta[i]=ft[i]-at[i];
totwt+=wt[i];
totta+=ta[i];
awt=(float)totwt/n;
ata=(float)totta/n;
printf("\nPname\tarrivaltime\texecutiontime\twaitingtime\ttatime");
for(i=0;i<n;i++)
printf("\n%s\t%5d\t\t%5d\t\t%5d\t\t%5d",pn[i],at[i],et[i],wt[i],ta[i]);
getch();
1902629 Page 24
Department of InformationTechnology
Output:-
19026
29 Page 25
Department of InformationTechnology
Task NO:- 5
• Once a process is executed for a given time period, it is preempted and other process
executes for a given time period.
Code:-
#include<stdio.h>
#include<conio.h>
void main()
{
scanf("%d", &NOP);
y = NOP;
1902629 Page 26
Department of InformationTechnology
printf("\n Enter the Arrival and Burst time of the Process[%d]\n", i+1);
scanf("%d", &at[i]);
scanf("%d", &bt[i]);
temp[i] = bt[i];
scanf("%d", &quant);
printf("\n Process No \t\t Burst Time \t\t TAT \t\t Waiting Time ");
for(sum=0, i = 0; y!=0; )
{
sum = sum + temp[i];
temp[i] = 0;
count=1;
1902629 Page 27
Department of InformationTechnology
y--;
printf("\nProcess No[%d] \t\t %d\t\t\t\t %d\t\t\t %d", i+1, bt[i], sum-at[i], sum-at[i]- bt[i]);
wt = wt+sum-at[i]-bt[i];
tat = tat+sum-at[i];
count =0;
if(i==NOP-1)
i=0;
else if(at[i+1]<=sum)
{
i++;
else
i=0;
avg_wt = wt * 1.0/NOP;
1902629 Page 28
Department of InformationTechnology
avg_tat = tat * 1.0/NOP;
getch();
Output:-
19026
29 Page 29
Department of InformationTechnology
Task NO:- 6
Theory:-
Priority scheduling :-
• Each process is assigned a priority. Process with highest priority is to be executed first
and so on.
• Processes with same priority are executed on first come first served basis.
• Priority can be decided based on memory requirements, time requirements or any other
resource requirement.
Code:-
#include<stdio.h>
#include<conio.h>
#include<string.h>
int main()
int et[20],at[10],n,i,j,temp,p[10],st[10],ft[10],wt[10],ta[10];
int totwt=0,totta=0;
float awt,ata;
1902629 Page 30
Department of InformationTechnology
char pn[10][10],t[10];
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%s%d%d%d",pn[i],&at[i],&et[i],&p[i]);
for(i=0;i<n;i++)
for(j=0;j<n;j++)
if(p[i]<p[j])
temp=p[i];
p[i]=p[j];
p[j]=temp;
temp=at[i];
at[i]=at[j];
at[j]=temp;
temp=et[i];
1902629 Page 31
Department of InformationTechnology
et[i]=et[j];
et[j]=temp;
strcpy(t,pn[i]);
strcpy(pn[i],pn[j])
; strcpy(pn[j],t); }
for(i=0;i<n;i++)
if(i==0)
st[i]=at[i];
wt[i]=st[i]-at[i];
ft[i]=st[i]+et[i];
ta[i]=ft[i]-
at[i]; }
else
st[i]=ft[i-1];
wt[i]=st[i]-at[i];
1902629 Page 32
Department of InformationTechnology
ft[i]=st[i]+et[i];
ta[i]=ft[i]-at[i];
totwt+=wt[i];
totta+=ta[i];
awt=(float)totwt/n;
ata=(float)totta/n;
printf("\nPname\tarrivaltime\texecutiontime\tpriority\twaitingtime\ttatime");
for(i=0;i<n;i++)
printf("\n%s\t%5d\t\t%5d\t\t%5d\t\t%5d\t\t%5d",pn[i],at[i],et[i],p[i],wt[i],ta[i]);
getch();
1902629 Page 33
Department of InformationTechnology
Outpit:-
19026
29 Page 34
Department of InformationTechnology
Task NO:- 7
Virtual box:
Oracle VM VirtualBox is a free and open-source hosted hypervisor for x86 virtualizations
developed by Oracle Corporation it was acquired by sun microsystems in 2008, which was
intern acquired by Oracle in 2010 VirtualBox may be installed on Windows and Mac OS.
1902629 Page 35
Department of InformationTechnology
STE
P 5:-click on next.
STEP 6:- select an amount of RAM for use.
1902629 Page 36
Department of InformationTechnology
STEP 7:-click on next.
STEP 8:-create your virtual machines.
STEP 9:- make
sure that your Ubuntu file is downloading.
1902629 Page 37
Department of InformationTechnology
STEP 10:-double click on the virtual machine name.
STEP 11:-click on the folder shaped icon.
STEP 12:- select your Ubuntu ISO.
STEP
13 :- click on install Ubuntu.
1902629
Page 38
Department of InformationTechnology
Task NO. :- 8
Title:- LINUX, file system, creating, copying, removing, renaming, and moving files in
LINUX operating system.
Objective:-
Theory:-
FILE SYSTEM:- It is used to control how data is stored and retrieved. Without a file
system, information placed in a storage area would be one large body of data with no way to
tell where one piece of information stops and the next begins.
There are many different kinds of file systems. Each one has different structure and logic,
properties of speed, flexibility, security, size and more. Some file systems have been designed
to be used for specific applications. For example, the ISO 9660 file system is designed
specifically for optical discs.
File systems can be used on many different kinds of storage devices. Each storage device
uses a different kind of media. The most common storage device in use today is a hard drive
whose media is a disc that has been coated with a magnetic film. In some cases, the
computer's main memory (RAM) is used to create a temporary file system for short term use
File system types can be classified into disk/tape file systems, network file systems and
special-purpose file systems.
1. Disk file systems:-A disk file system takes advantages of the ability of disk storage
media to randomly address data in a short amount of time. This permits multiple users access
1902629 Page 39
Department of InformationTechnology
to various data on the disk without regard to the sequential location of the data. Examples
include FAT, exFAT, NTFS, HFS and
2. Flash file systems:- A flash file system considers the special abilities, performance
and restrictions of flash memory devices. Frequently a disk file system can use a flash
memory device as the underlying storage media but it is much better to use a file system
specifically designed for a flash device.
3. Tape file systems:- A tape file system is a file system and tape format designed to
store files on tape in a self-describing form. Magnetic tapes are sequential storage media with
significantly longer random data access times than disks, posing challenges to the creation
and efficient management of a general-purpose file system.
4. Database file systems:- Another concept for file management is the idea of a
database-based file system. Instead of, or in addition to, hierarchical structured management,
files are identified by their characteristics, like type of file, topic, author, or similar. Very
large file systems, embodied by applications like Apache Hoodoo and Google File System,
use some database file system concepts.
5. Transactional file systems:-Transaction processing introduces the isolation
guarantee, which states that operations within a transaction are hidden from other threads on
the system until the transaction commits, and that interfering operations on the system will be
properly serialized with the transaction.. This means that if there is a crash or power failure,
after recovery, the stored state will be consistent.
6. Network file systems:- A network file system is a file system that acts as a client for a
remote file access protocol, providing access to files on a server. Examples of network file
systems include clients for the NFS, AFS, SMB protocols, and file-system-like clients for
FTP and WebDAV.
7. Shared disk file systems:- A shared disk file system is one in which a number of
machines (usually servers) all have access to the same external disk subsystem (usually a
SAN). The file system arbitrates access to that subsystem, preventing write collisions.
1902629 Page 40
Department of InformationTechnology
Examples include GFS2 from Red Hat, GPFS from IBM, SFS from Dataflow, CXFS from
SGI and StorNext from Quantum Corporation.
(1)FAT:- File Allocation Table FAT is supported by almost all operating systems for
personal computers, including all versions of Windows and MS-DOS/PC DOS and DR
DOS. SCP86-DOSDigital Research Concurrent DOSCP/M-86The FAT file systems are
therefore well-suited as a universal exchange format between computers and devices of
most any type and age. Over the years, the file system has been expanded from FAT12 to
FAT16 and FAT32. Various features have been added to the file system including
subdirectories, codepage support, extended attributes, and long filenames.
The FAT12 and FAT16 file systems had a limit on the number of entries in the root directory
of the file system and had restrictions on the maximum size of FAT-formatted disks or
partitions.FAT32 addresses the limitations in FAT12 and FAT16, except for the file size limit
of close to 4 GB, but it remains limited compared to NTFS.
(2) NTFS:- NTFS, introduced with the Windows NT operating system in 1993, allowed
ACL-based permission control. Other features also supported by NTFS include hard
links, multiple file streams, attribute indexing, quota tracking, sparse files, encryption,
compression, and reparse points (directories working as mount-points for other file
systems, symlinks, junctions, remote storage links
(3) exFAT:- exFAT is a proprietary and patent-protected file system with certain
advantages over NTFS with regard to file system overhead.exFAT is not backward
compatible with FAT file systems such as FAT12, FAT16 or FAT32. The file system is
supported with newer Windows systems, such as Windows Server 2003, Windows Vista,
Windows 2008, Windows 7, Windows 8, and more recently, support has been added for
Windows XP.[20]exFAT is supported in Mac OS X starting with version.
1902629 Page 41
Department of InformationTechnology
(2)CAT:-This command is used to display the contents of a file. You can read the
content of a file using cat command. Because by using command touch can can’t be
able to write on a file you can only able to create a new empty file .That’s why by
using cat command we can write on our new file.
Syntax for this command:- cat > file name
Example:- $ cat > a4
This mean we are writing something in file a4 then we save the content by using ctrl
d.
If we want to see the content of file a4 then we write command $cat a4 .
We can also copy multiple files .
Example:- cat a4 a5 > b1
This mean we are copying contents of both file a4 and a5 into file b1.
• To study commands for copying file in Linux : CP
For example:- cp file footmarks an exact copy of the file whose name you entered
and name the copy too, but the first file will still exist with its original name. After
you use mv, the original file no longer exists, but after you use cp, that file stays and a
new copy is made.
1902629 Page 42
Department of InformationTechnology
Cp file 1 file 2
Example:- cp a4 a5
This command means we are copying content of file a4 to file a5.
• To study command for Removing ,Renaming and Moving file : RM
,MV
(1) MOVING COMMAND :- MV
The MV command - move - allows a user to move a file to another folder or directory.
MV command can be used to move any number of files and folders in a single
command.
The syntax is as follows:-
mv source target mv folder1 folder2 target mv folder1 file1 target mv -option source
target
An example of the mv command is:-
mv [option(s)] source file target file
Copies source file to target file then deletes the original source file..
(2) RENAMING COMMAND :-In order to rename a file in Linux you can use
either of two approaches
(A)Create a copy of the existing file with the new desired name and then delete the old
Rename with copy and delete.
1902629 Page 43
Department of InformationTechnology
This creates a copy of the same file with a new name in the same location.
$ rm oldfile
This will delete the old file keeping the newfile intact file.
EXAMPLE:-
Rename by moving
This just moves the old file, to a new name. rm [option(s)] file(s)
Removes the specified files from the file system. Directories are not removed by rm
unless the option -r is used.
-r Deletes any existing subdirectories . -I Waits for confirmation before deleting each
file
Renaming a directory in Linux and Unix is similar to renaming a file. All we need to do is
replace the file name with the directory name that is to be renamed.
For example, if we wanted to rename the directory “RR1″ to “ST1″, then we can use the
following command.
$ mv RR1 ST1
(3)REMOVING COMMAND: RM
The rm command - remove - like the rmdir command is meant to remove files
from your Linux OS. Whereas the rmdir command will remove directories and
1902629 Page 44
Department of InformationTechnology
files held within, the rm command will delete created files. An example of the rm
command:
rm testfile.txt
The aforementioned command removed testfile.txt. Interestingly, whereas the
rmdir command will only delete an empty directory, the rm command will remove
both files and directories with files in it. This said, the rm command carries more
weight than the rmdir command and should be used with more specificity.
Task No. :- 9
TITLE:- Listing files and directory, changing file permission and directory related
commands.
OBJECTIVE:-
• To study the commands for listing files and directory: ls , ls-a , ls-l , ls using wild cards.
• To study commands for changing permission of files:chmod
• To study commands for changing directory,creating directory,removing directory and to
see present working directory: mkdir , rmdir ,cd , pwd .
THEORY:-
• To study the commands for listing files and directory: ls , ls-a , ls-l , ls
using wild cards.
Basically ls means listing files .so files can be hidden , it can be long listing ,or it can
be existing files so that’s why ls command can be used in many ways i.e.
1. Ls
2. Ls – a
3. Ls – l
4. Ls - a – l
5. Ls using wild cards
1. LS COMMAND: - This command is used for showing exixting all files and
directory ,when ever we want to see saved files and directory we always use ls
command for it .it shows file with different colors like blue color shows
directories and while colour shows files .
2. LS – A COMMAND:- This command is used to listing out all hidden files.
That’s why for viewing hidden files we use ls- a command.sometime we hide
our file for preveting its viewing that’s why to see hidden files we use this
command.
1902629 Page 46
Department of InformationTechnology
Example for ls and ls – a command :-
3. LS- L COMMAND :- This command is used for viewing long listing files , it means it
shows a long list of many no of files .
Example :-
Example for ls – a
and ls – l command:-
1902629 Page 47
Department of InformationTechnology
Example-
:- 5.
1902629 Page 48
Department of InformationTechnology
Example:-
1902629 Page 49
Department of InformationTechnology
1902629 Page 50
Department of InformationTechnology
Task No.:- 10
(1) LOGNAME COMMAND:- This command tells the user name on which we are
working .
(2) WHO COMMAND:- This display all user name that are working on our
computer.
1902629 Page 51
Department of InformationTechnology
(3) WHO
1902629 Page 52
Department of InformationTechnology
(6)
WC COMMANMD:- WC means word count . Thisa command counts the no of
lines and no of characters .
(7)
SORT COMMAND:- This is very important command .this command is used to sort
inside file details accordingly.
1902629 Page 53
Department of InformationTechnology
(8) GREP
COMMAND:- This command is also very important command .GREP means globally
search a regular expression and print it .By using this command we can search single
letter in file and also can search through line content in a file .
1902629 Page 54
Department of InformationTechnology
Task No. :- 11
OBJECTIVES:-
SHELL:-Shell provide a environment where users can runs its commands ,programs ,and
shell script.
Typical operations performed by shell scripts include file manipulation, program execution,
and printing text.
• Perhaps the biggest advantage of writing a shell script is that the commands and syntax
are exactly the same as those directly entered at the command line. • On the other hand,
shell scripting is prone to costly errors.
• Another significant disadvantage is the slow execution speed and the need to launch a
new process for almost every shell command executed.
1902629 Page 55
Department of InformationTechnology
EXAMPLE:-
READ COMMAND:- this command is used when user want to enter different
values to the different types . so by using this command we can insert values to data.
1902629 Page 56
Department of InformationTechnology
1902629 Page 57
Department of InformationTechnology
program. OBJECTIVE:-
1902629 Page 58
Department of InformationTechnology
CONDITIONAL STATEMENT:- conditional statements are those whose
outcome depends upon some condition i.e. either they are true or false .basdicaly these
statements are if , else , else if etc.nested of these statements are true.
✓ EXAMPLE:- If………..then……….fi
✓ If………..then….. ..else……..fi
1902629 Page 59
Department of InformationTechnology
❖ Not equal to---(-ne)
❖ Greater then---(gt)
❖ Greater then equal to---(-ge)
❖ Less then equal to---(-le)
EXAMPLE:-
1902629 Page 60