UNIT-II CCP Notes PDF
UNIT-II CCP Notes PDF
It is a system software, which is closely associated with the computer hardware and provides
the interface between the user and resources of the computer, such as central processing unit,
memory, files and I/O devices. In simple words, we can say that, it is a program which
supervises and controls the operation of a computer.
As DOS was written by Microsoft Corporation, usually it is called MS-DOS. IBM has been
licensed to use and sell the same DOS with their computer. In that case, when it marketed by
IBM, the DOS is called PC-DOS, there are many operating systems, like UNIX, OS/2, VMS, etc.,
but DOS is the most popular operating system.
Knowledge about DOS is very essential for computer users, otherwise it is not possible to use
the computer efficiently. It is not essential to have a thorough knowledge about DOS, some of
the basic commands will be sufficient for most of the purposes. The commands are discussed in
this chapter. The recent versions of MS-DOS contain extensive online help. You can refer to it
any time by typing HELP at the command prompt. There are many functions performed by DOS,
few of them are listed below.:
1. Coordinates the input/output devices such as monitor, printers, plotters, disk drivers,
etc.
2. Configures the computer hardware for required purposes.
3. Maintains an orderly system of files on the disk.
4. Customizes for international use (you can change the keyboard layout, character set and
even the language according to your choice within a given set).
5. Manages computer’s memory.
6. Enables the user to load and execute the programs.
SETTING UP DOS
As soon as you switch on the computer, two special built-in programs are executed from the
start up program called bootstrap loader. The first does a self testing of the computer to see
that things are in the working order and second one starts up DOS. The bootstrap operation
works in two stages in a file named COMMAND.COM and made memory resident. These
commands are called internal commands. You cannot see them in a directory list as these are
part of COMMAND. COM file. The rest of the commands are called external commands, and are
stored in a separate file individually. They occupy the memory only when you call them
Internal commands
As said earlier, the internal commands are stored in COMMAND.COM file and these will always
be present in the memory. You can access these commands irrespective of the directory in
which you are working. Before discussing the DOS commands, it is essential to know how the
information is organized in the computer. As you know, a complete collection of related data is
called a file. The data here refers to any item of information that you want to save in a
computer memory. For example, a FORTRAN program file, a letter, a mailing list, etc. Each
individual file will have a specific name. The file name consists of two parts, file name and
extensions separated by a period (.), e.g., COMMAND. COM. Though the use of extension is not
compulsory for user’s file, they will be useful in many ways. Some of the application
software/languages assign a specific extension to the file name given by the user automatically.
For example, FORTRAN will assign “for” as extension to all program. No two files can have the
same names and extension in the same directory. A group of such files constitutes a directory.
Usually, all the files related to software are stored in a single directory. If you need to group
user files and store them in another directory, you can always do so by creating a subdirectory.
This is particularly a good practice because you are separating user files from the software files,
thus protecting the software files from getting corrupted unknowingly. With this brief
introduction to files and directories, we shall now move on to the internal commands.
DIR: This command displays a list of files and subdirectories that all in the directory you
specify.
Syntax Dir [drive] [Path] [File name] [/P] [/W]
Using Wildcards: The symbol* (asterisk) and ? (question mark) are called wildcards in DOS.
You can use them to display a listing of subsets of files and subdirectories. The following
examples illustrate the use of wildcards.
Example: 1. dir C:\ws7*.txt, displays all the files and subdirectories with extensions, .txt in the
parent directory ‘w7’ in ‘C’ drive.
Example 2. dir C:\ws7\.txt, displays all the files and subdirectories whose names being with ‘ws’
irrespective of the trailling (following) characters in the file name of parent directory ‘ws7’ in ‘C’
drive. CD or CHDIR, displays the name of the current directory or changes the current directory
to the specified directory.
Syntax 1. CD [drive] [Path], or 2, cd…, or 3. cd/ in case of 1, the directory will be changed to the
one you specify for ex. cd C:\dos changes the directory to the directory named ‘dos’. If you are
not changing the drive you need not specify the drive name. In case 2, you will be changing
back to parent directory from subdirectory. In case 3, you will be changing the root directory
from current directory. The root directory is the top of the directory hierarchy for a drive.
MD (Make Directory): Using this command, you can create a directory or a subdirectory
under a parent directory. Syntax MD [drive:] [Path] [directory name] [drive:] Specifies the drive
on which you want to create a ‘new directory’. [Path] [directory name] Specifies the name and
location of the new directory. For example, to create a new directory named FORTRAN on drive
A: simply type the following and press enter key. MD A:\FORTRAN
RD (Remove Directory): Using this command, you can delete a directory provided the
directory is empty, i.e., it does not contain any files in it.
Syntax RD [drive:] [Path] [directory name] The components of this syntax has the same meaning
as in MD.
Copy: Copy one or more files to the location you specify. Syntax Copy [source] [destination].
Source: Specifies the location and name of a file or a set of files from which you want to copy.
For example, if you want to copy a file named readme.txt under ‘ws7’ directory in drive C: you
can specify it as follows. C:\ws7\readme.txt
CLS: This command clears the screen. The cleared screen will have command prompt and
cursor only at the top left corner. Syntax CLS
REN OR RENAME: Changes the name of the files you specify. Syntax REN [Drive:] [Path]
[Filename1 Filename2] You can also make use of wildcards to change the name of a group of
files that matches your specification You cannot change name of a directory or subdirectory
and move the files across the drives using the command.
Exercise:
1. Distinguish between internal and external DOS commands.
2. What are wildcards in DOS?
3. Explain the booting process.
4. Give syntax and explain:
(a) MD
(b) RD
(c) COPY
(d) CLS
(e) REN
Users of any Windows system can invoke a command prompt by performing the following
steps:
1. Click Start.
2. Select Run.
3. In the "Open:" field, type command.
4. Click OK.
A command prompt window is generally white or gray text on a black background. The prompt
itself usually takes the following form:
X:\PATH>
where "X" represents the letter of the active drive, and "PATH" refers to the present working
directory. Here's an example of how a DOS command prompt commonly looks:
C:\Windows>_
Commands are typed and echoed to the screen at the cursor's location. Usually commands
consist of a keyword, followed by optional flags, followed by a path. More will be explained
about syntax and additional flags under each specific command.
CD[..]
EXAMPLES
● cd \ - Changes current directory to the highest level of the current drive (the root
directory).
● cd .. - Goes up one directory. For example if you are within the
C:\WINDOWS\COMMAND> directory this would take you to C:\WINDOWS>
● cd windows - Changes to the Windows subdirectory of the current directory (if it exists).
Note: If you want to change to a different drive, CD will not switch to it. CD only changes
directories in the current drive. To change drives, type the drive letter followed by a colon. i.e.
cd d: will not switch to the d drive, but d: will switch drives.
COPY: Copies one or more files to another location. If trying to copy files longer the 8
characters, DOS will truncate them with normal COPY. Also COPY will not move all files, it will
leave Hidden and System files alone. Use XCOPY instead to solve both of these issues.
Syntax: COPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination] [/A | /B]] [/V] [/Y
| /-Y]
Basic Features:
Following are some of the important features of Linux Operating System.
● Portable − Portability means software can works on different types of hardware in same
way. Linux kernel and application programs supports their installation on any kind of
hardware platform.
● Open Source − Linux source code is freely available and it is community based
development project. Multiple teams work in collaboration to enhance the capability of
Linux operating system and it is continuously evolving.
● Multi-User − Linux is a multiuser system means multiple users can access system
resources like memory/ ram/ application programs at same time.
● Multiprogramming − Linux is a multiprogramming system means multiple applications
can run at same time.
● Hierarchical File System − Linux provides a standard file structure in which system files/
user files are arranged.
● Shell − Linux provides a special interpreter program which can be used to execute
commands of the operating system. It can be used to do various types of operations, call
application programs. etc.
● Security − Linux provides user security using authentication features like password
protection/ controlled access to specific files/ encryption of data.
List of Basic UNIX/Linux shell commands
Following is just the very basic list of some useful commands.
Files and directories
● pwd: shows current directory.
● cd directoryname: makes directoryname your current directory. cd with no parameters
● switches to your home directory
● ls directoryname: lists contents of directories. Use ls -l for more information about the
files.
● You can limit the list with wildcards (e.g., “ls /home/mydirectory/*.txt”)
● mkdir directoryname: creates a new directory.
● cp source destination: makes a copy of a file named “source” to “destination”.
● cp –r source destination: copies a directory and its content
● mv source destination: moves a file or directory.
● rm filenamelist: removes/deletes file(s). Be careful with wildcards.
● rm –r directory: removes directory (-ies) including its content
File Permissions Commands: The chmod and chown commands are used to control access to
files in UNIX and Linux systems.
● chown : Used to change the owner of file.
● chmod : Used to modify the access/permission of a user.