Fundamental 5th Unit Eng

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

Vivekanand computer 2022

Unit -5 (Fundamental)

What is a disk operating system ?


A DOS, or disk operating system, is an operating system that runs from a disk
drive. The term can also refer to a particular family of disk operating systems,
most commonly MS-DOS, an acronym for Microsoft DOS.

An operating system (OS) is the software that controls a computer's hardware


and peripheral devices and allows other software programs to function. Early
computers of the 1940s and 1950s did not have disk drives. Instead, they
were hard-wired to carry out specific computations.

Later, computers were able to store instructions loaded into the computer's
memory using punch cards and then, after that, magnetic tapes. Computer
memory space was limited, and when the instructions to control a computer
were moved onto a disk drive, such as a floppy disk or internal HDD, it was
considered cutting-edge technology.

DOS is also used to describe several similar command-line disk operating


systems. Early computers, such as the Commodore 64, Atari 800 and Apple
II, all featured a disk operating system, including Commodore Business
Machines DOS, Atari DOS and Apple DOS, respectively. DOS/360 was an
OS for IBM mainframes, which first appeared in 1966, but it is unrelated to the
8086-based DOS of the 1980s.

DOS features
Among the features and limitations of disk operating systems are the
following.

VIVEKANAND COMPUTER N Page 1


Vivekanand computer 2022

Features

 Command-line interface (CLI). It does not have a GUI and doesn't accept
mouse inputs. It is a character-based interface system where all
commands are entered in text at the command-line prompt.

 Management. A disk operating system can manage a computer's files, I/O


system and its memory.
Limitations

 No built-in security. It does not have built-in security, such as file


ownership and permissions.

 No multiusers or multitasking. It also does not support multiusers or


multitasking. It is only able to run one program at a time, but it provides
direct access to the basic I/O system and underlying hardware.

 Challenging interface. The CLI, in which a user must type in commands,


requires the user to remember commands to run programs and do other
OS tasks. This approach makes it difficult for novices to use. For example,
typing the command cd \directory_name changes the current working
directory to the named directory and typing the command dir lists the files
in the current directory.

Internal DOS commands


These are those commands for which the code for executing them is
stored in COMMAND.COM and they execute without the
requirement of any other file. When an internal command is issue by
the user, the transient portion knows what to do and executes that
command.

Date Command

VIVEKANAND COMPUTER N Page 2


Vivekanand computer 2022

It displays the current system date and prompts you to change the
date, if necessary.
Syntax : C:\>date < mm-dd-yy >

Time
It sets the computer‘s internal clock if command is issued with
parameters otherwise displays the systemtime.
Syntax : C:\>time < hours: minutes: seconds: hundredths >

CLS COMMAND
It clears the screen. The cleared screen shows only the command
prompt and the blinking cursor.
Syntax : C:\>cls

Ver
Ver command displays the MS-DOS version no.
Syntax : C:\>ver

Vol
It displays the current volume label and the serial number of the
specified drive. If drive specifier is omitted Vol takes the current
drive by default.
Syntax : C:\vol < d:>

Break
It enables the DOS to check for Ctrl + C and Ctrl – break as the
signal to terminate the current program less frequently. If you run
Break without any parameters, the current state of break checking is
displayed.
Syntax : C:\>break < on/off >

VIVEKANAND COMPUTER N Page 3


Vivekanand computer 2022

MKDIR (or MD)


With the help of this command we create directory or folder
directory name can be upto 8 character and extension name 3
character . It creates a multilevel directory.

Syntax : C:\>MKDIR (or MD) < drive: > < path >
Example
C:/>MD RAKESH

CHDIR (or CD)


It changes the current directory or displays the name of the current
directory.
Syntax : C:\>CHDIR (or CD) < drive: > < path >

Dir Command
It displays the list of the files and sub-directories that are in the
directory specified.
Syntax : C:\> dir < drive: > < path > < filename >

Switch of Dir command

Dir/p – display dirr or file page wise


Dir/w – Display file or dir column wise
Dir/a- Display file or directory normal and hidden also
Dir/ah – display file or directory hidden only

Copy command
It copy one or more files to the location specified and can also be
used to combine.
Syntax : C:\>copy < source > < target >

VIVEKANAND COMPUTER N Page 4


Vivekanand computer 2022

EDLIN command
It is the line-oriented text editor.
Syntax : C:\>EDLIN < filename >

Del
It deletes the files specified.
Syntax : C:\>del < drive: > < path > < filename >

Prompt
It changes the appearance of the command prompt or displays the
current prompt.
Syntax : C:\>prompt < text >

RMDIR (or RD)


It removes the directory.
Syntax : C:\>RMDIR (or RD) < drive: > < path >

Rename (or REN)


It changes the name of the file or files specified and can also rename
all files matching the specified filename.
Syntax : C:\>rename (or REN) < drive: > < path >< original
filename > < changed filename >

Type
It displays the contents of a text file or view the contents of any text
file without modifying it.
Syntax : C:\>type < drive: > < path > < filename >

Path
It is used to earch for the executable files in the directories specified.
Syntax : C:\> path < drive: > < path > < ………… >

VIVEKANAND COMPUTER N Page 5


Vivekanand computer 2022

Verify
It verifies that the files are written correctly to the disk.
Syntax : C:\>verify

External commands
These are the independent executable files that can be used as
separate utilities also. Information about these files is also stored in
the transient portion. When an external command is issued, the
transient portion picks up the relevant file of that command and
executes it.

Attrib
It lets you display or alter the attributes assigned to a file or
directory.
Syntax : C:\>attrib < +A/-A > < +H/-H > < +R/-R >< +S/-S >< d:
>< path > < filename >

Chkdsk
It checks a disk‘s file allocation table entries for errors and find
whether the files are o.k. or not.
Syntax : C:\>chkdsk < d:> < path> < filename>

Comp -It compares two files byte-by-byte and reports the


differences.
Syntax : C:\>comp < d:>[ < path + filename>]< d:>[< path+
filename>]

Format
It creates a new directory and file allocation table for the disk.
Syntax : C:\>format < drive name>

VIVEKANAND COMPUTER N Page 6


Vivekanand computer 2022

Scandisk
It checks a drive for errors and corrects any problems that it finds.
Syntax : C:\> scandisk < drive name>

Tree
The structure of the specified drive from the specified directory
down, listing all the sub-directories it encounters is displayed
graphically.
Syntax : C:\>tree < drive name>

Deltree
It deletes a directory and all the files and sub-directories contained
within it.
Syntax : C:\>deltree < drive>< path>

XCopy
It is used to copy all the files in a directory, including the files in the
sub-directories of that directory.
Syntax : C:\>xcopy < source> < destination>

Print
It prints a text file.
Syntax : C:\>print < filename>

FDisk
It is the tool, DOS provides for setting up and managing hard disk
partitions.
Syntax : C:\>fdisk

Label

VIVEKANAND COMPUTER N Page 7


Vivekanand computer 2022

It lets you create, modify or delete the label assigned to a disk.


Syntax : C:\>label < drive name>

Doskey
It edits command lines, recalls command lines and creates macros.
Syntax : C:\>doskey

More
It displays one screen of output at a time and in end of each screen
displays the message.
Syntax : C:\>more < drive:> < path> < filename>

Backup
It lets the user to take the backup of hard disk files to floppies.
Syntax : C:\>backup < source> < destination>

Restore
It restores the files that were backed up on a floppy.
Syntax : C:\>restore < drive1> < drive2> < path> < filename>

Mem
It displays amount of used and free memory in the system.
Syntax : C:\>mem

FC
It compares two files or sets of files and displays the difference
between them.
Syntax : C:\>fc < drive>< filename1> < drive>< filename2>

What is Booting

VIVEKANAND COMPUTER N Page 8


Vivekanand computer 2022

Booting is the process of starting a computer. It can be initiated by hardware such as a


button press or by a software command. After it is switched on, a CPU has no software
in its main memory, so some processes must load software into memory before
execution. This may be done by hardware or firmware in the CPU or by a separate
processor in the computer system.

Type of Booting

1. Cold Booting: When the computer starts for the first time or is in a shut-down
state and switch on the power button to start the system, this type of process to
start the computer is called cold booting. During cold booting, the system will
read all the instructions from the ROM (BIOS) and the Operating System will be
automatically get loaded into the system. This booting takes more time than Hot
or Warm Booting.
2. Warm Booting: Warm or Hot Booting process is when computer systems come
to no response or hang state, and then the system is allowed to restart during on
condition. It is also referred to as rebooting. There are many reasons for this
state, and the only solution is to reboot the computer. Rebooting may be
required when we install new software or hardware. The system requires a reboot
to set software or hardware configuration changes, or sometimes systems may
behave abnormally or may not respond properly. In such a case, the system has
to be a force restart. Most commonly Ctrl+Alt+Del button is used to reboot the
system. Else, in some systems, the external reset button may be available to
reboot the system.

Booting Process in Operating System


When our computer is switched on, it can be started by hardware such as a
button press, or by software command, a computer's central processing unit
(CPU) has no software in its main memory, there is some process which must load
software into main memory before it can be executed. Below are the six steps to
describe the boot process in the operating system, such as:

VIVEKANAND COMPUTER N Page 9


Vivekanand computer 2022

Step 1: Once the computer system is turned on, BIOS (Basic Input /Output System)
performs a series of activities or functionality tests on programs stored in ROM, called
on POST (Power-on Self Test) that checks to see whether peripherals in the system are
in perfect order or not.

Step 2: After the BIOS is done with pre-boot activities or functionality test, it read
bootable sequence from CMOS (Common Metal Oxide Semiconductor) and looks for
master boot record in the first physical sector of the bootable disk as per boot device
sequence specified in CMOS. For example, if the boot device sequence is:

o Floppy Disk
o Hard Disk
o CDROM

Step 3: After this, the master boot record will search first in a floppy disk drive. If not
found, then the hard disk drive will search for the master boot record. But if the master
boot record is not even present on the hard disk, then the CDROM drive will search. If
the system cannot read the master boot record from any of these sources, ROM
displays "No Boot device found" and halted the system. On finding the master boot
record from a particular bootable disk drive, the operating system loader, also called
Bootstrap loader, is loaded from the boot sector of that bootable drive· into memory. A
bootstrap loader is a special program that is present in the boot sector of a bootable
drive.

Step 4: The bootstrap loader first loads the IO.SYS file. After this, MSDOS.SYS file is
loaded, which is the core file of the DOS operating system.

Step 5: After this, MSDOS.SYS file searches to find Command Interpreter


in CONFIG.SYS file, and when it finds, it loads into memory. If no Command Interpreter
is specified in the CONFIG.SYS file, the COMMAND.COM file is loaded as the default
Command Interpreter of the DOS operating system.

VIVEKANAND COMPUTER N Page 10


Vivekanand computer 2022

Step 6: The last file is to be loaded and executed is the AUTOEXEC.BAT file that
contains a sequence of DOS commands. After this, the prompt is displayed. We can see
the drive letter of bootable drive displayed on the computer system, which indicates
that the operating system has been successfully on the system from that drive.

What is Linux Operating System


Linux is an open-source operating system like other operating systems such
as Microsoft Windows, Apple Mac OS, iOS, Google android, etc. An
operating system is a software that enables the communication between
computer hardware and software. It conveys input to get processed by the
processor and brings output to the hardware to display it. This is the basic
function of an operating system. Although it performs many other
important tasks, let's not talk about that.

Linux is around us since the mid-90s. It can be used from wristwatches to


supercomputers. It is everywhere in our phones, laptops, PCs, cars and even
in refrigerators. It is very much famous among developers and normal
computer users.

Structure Of Linux
Operating System
An operating system is a collection of
software, each designed for a specific
function.

Linux OS has
following
components:

1) Kernel
Linux kernel is the core part of
the operating system. It

VIVEKANAND COMPUTER N Page 11


Vivekanand computer 2022

establishes communication between devices and software. Moreover, it manages system


resources. It has four responsibilities:

o device anagement: A system has many devices connected to it like CPU, a


memory device, sound cards, graphic cards, etc. A kernel stores all the data
related to all the devices in the device driver (without this kernel won't be able to
control the devices). Thus kernel knows what a device can do and how to
manipulate it to bring out the best performance. It also manages communication
between all the devices. The kernel has certain rules that have to be followed by
all the devices.
o Memory management: Another function that kernel has to manage is the
memory management. The kernel keeps track of used and unused memory and
makes sure that processes shouldn't manipulate data of each other using virtual
memory addresses.
o Process management: In the process, management kernel assigns enough time
and gives priorities to processes before handling CPU to other processes. It also
deals with security and ownership information.
o Handling system calls: Handling system calls means a programmer can write a
query or ask the kernel to perform a task.

VIVEKANAND COMPUTER N Page 12


Vivekanand computer 2022

Vi Editor with Commands


What is vi
The vi editor is elaborated as visual editor. It is installed in every Unix system. In other
words, it is available in all Linux distros. It is user-friendly and works same on different
distros and platforms. It is a very powerful application. An improved version of vi editor
is vim. The vi editor tool is an interactive tool as it displays changes made in the file on the
screen while you edit the file. In vi editor you can insert, edit or remove a word as cursor moves
throughout the file.

Commands are specified for each function like to delete it's x or dd.

The vi editor is case-sensitive. For example, p allows you to paste after the current line
while P allows you to paste before the current line.

vi syntax:

1. vi <fileName>

The vi editor has two modes:

o Command Mode: In command mode, actions are taken on the file. The vi editor
starts in command mode. Here, the typed words will act as commands in vi
editor. To pass a command, you need to be in command mode.
o Insert Mode: In insert mode, entered text will be inserted into the file.
The Esc key will take you to the command mode from insert mode.

By default, the vi editor starts in command mode. To enter text, you have to be in insert
mode, just type 'i' and you'll be in insert mode. Although, after typing i nothing will
appear on the screen but you'll be in insert mode. Now you can type anything.

To exit from insert mode press Esc key, you'll be directed to command mode.

To switch from command to insert mode:

Command Action

VIVEKANAND COMPUTER N Page 13


Vivekanand computer 2022

i Start typing before the current character

I Start typing at the start of current line

a Start typing after the current character

A Start typing at the end of current line

o Start typing on a new line after the current line

O Start typing on a new line before the current line

Linux Command
The Linux command is a utility of the Linux operating system. All basic and advanced tasks can
be done by executing commands. The commands are executed on the Linux terminal. The
terminal is a command-line interface to interact with the system, which is similar to the
command prompt in the Windows OS. Commands in Linux are case-sensitive.

Linux Directory Commands

1. pwd Command -The pwd command is used to display the location of the
current working directory.

Syntax:

$ pwd

2. mkdir Command -The mkdir command is used to create a new directory under
any directory.
Syntax:
$ mkdir <directory name>

VIVEKANAND COMPUTER N Page 14


Vivekanand computer 2022

3. rmdir Command- The rmdir command is used to delete a directory.

Syntax:

$ rmdir <directory name>

4. ls Command-The ls command is used to display a list of content of a directory.

Syntax:

$ ls

5. cd Command -The cd command is used to change the current directory.

Syntax :

$ cd <directory name>

Linux File commands


6. touch Command-The touch command is used to create empty files. We can create
multiple empty files by executing it once.

Syntax:

$ touch <file name>


touch <file1> <file2> ....

7. cat Command -The cat command is a multi-purpose utility in the Linux system. It can
be used to create a file, display content of the file, copy the content of one file to
another file, and more.

Syntax:

$ cat [OPTION]... [FILE].. example - cat > <file name>

8. rm Command-The rm command is used to remove a file.

Syntax:

$ rm <file name>

VIVEKANAND COMPUTER N Page 15


Vivekanand computer 2022

9. cp Command-The cp command is used to copy a file or directory.

Syntax:

To copy in the same directory:

$ cp <existing file name> <new file name>

10. mv Command- The mv command is used to move a file or a directory form one
location to another location.

Syntax:

$ mv <file name> <directory path>

11. rename Command-The rename command is used to rename files. It is useful for
renaming a large group of files.

Syntax:

$ rename 's/old-name/new-name/' files

12. head Command-The head command is used to display the content of a file. It
displays the first 10 lines of a file.
Syntax:
$ head <file name>

13. tail Command-The tail command is similar to the head command. The difference
between both commands is that it displays the last ten lines of the file content. It is
useful for reading the error message.

Syntax:

$ tail <file name>


15. more command-The more command is quite similar to the cat command, as it is used to
display the file content in the same way that the cat command does. The only difference
between both commands is that, in case of larger files, the more command displays screenful
output at a time.

VIVEKANAND COMPUTER N Page 16


Vivekanand computer 2022

1. In more command, the following keys are used to scroll the page:
2. ENTER key: To scroll down page by line.
3. Space bar: To move to the next page.
4. b key: To move to the previous page.

16 wc Command-The wc command is used to count the lines, words, and characters in


a file.

Syntax:

$ wc <file name>

17 -sort Command-The sort command is used to sort files in alphabetical order.

Syntax:

$ sort <file name>

18 date Command- The date command is used to display date, time, time zone, and
more.
Syntax:
$ date

19 cal Command-The cal command is used to display the current month's calendar with
the current date highlighted.

Syntax:

1. $ cal

20 time Command-The time command is used to display the time to execute a


command.

Syntax:

1. $ time

VIVEKANAND COMPUTER N Page 17


Vivekanand computer 2022

21 exit Command-Linux exit command is used to exit from the current shell. It takes a
parameter as a number and exits the shell with a return of status number.

Syntax:

$ exit

22 clear Command-Linux clear command is used to clear the terminal screen.

Syntax:

$ clear

VIVEKANAND COMPUTER N Page 18

You might also like