Drives
Drives are logical partitions of the hard disk or may be extension to the hard disk.
A convention is followed while giving names to these partitions. For example, A:,
B: represents Floppy disk. C:, O:, E: represents Hard Disk, and F:, G: represents
the Compact Disk.
To switch from one drive to another, only the drive letter followed by a colon
needs to be specified. For example, at C:\> type A: and press <Enter>. This will
take you to A:
While doing any directory or file manipulation user must take note of your
location.
Location of a file or directory always starts with the drive letter (which is the root)
followed by the name of its parent in one order and finally its own name.
For example, C:\Program Files\Microsoft Office\Office\MS Word
Implies that the root is C:\, one of the folders in C:1 is Program Files, Program
Files contains Microsoft Office folder, which in turn contains office folder, which in
turn contains MS Word.
Page | 69
E-Content of
IT TOOLS AND BUSINESS SYSTEM
Command prompt
Page | 55
E-Content of
IT TOOLS AND BUSINESS SYSTEM
Opening a command prompt:
There are two conventional ways to start a Command prompt.
Start->Programs-> Accessories->Command prompt
Start->Run and type "cmd" and press enter.
The Command Prompt shows up as a black terminal window. The command
prompt should look something like: C:\>
Directory Navigation
Page | 56
E-Content of
IT TOOLS AND BUSINESS SYSTEM
CD Windows : If you want to change to the "system" directory (which is a sub
directory of "windows"), you would enter
CD System : However if you knew that you wanted to change to the system
directory immediately, you could type this command.
CD Windows\System : However if you were already deep in another
directory (for example c:\ documents and settings \username\ local settings)
and then wanted to move directly to windows\system then you can do that by
putting in an initial backwards slash.
CD \Windows\System : This tells the command to go to the root of the drive,
then to the directory Windows and system.
Moving Back Up : You can also move back up the tree, instead of down.
cd \ or cd\ : to just return to the root of the drive (C:\)
cd.. : to just go back one level (to use the earlier example, you were in
c:\windows\system and you wanted to be in c:\windows).
cd program files or cd "program files" : to access a totally different
directory, for example "Program Files". When typing directories to change to,
if the directory name is unique, then you can use wild cards. For example : cd
program.
dir - This command will list all of the folders and files in the directory you are
currently at.
cd folder - This command will move you to the folder that you specify. The
folder must be in the directory you are currently in. For example: If you are
currently at C:\Users\username\ and you enter cd desktop you will be taken
to C:\Users\username\Desktop\
cd path - This command will take you to a specific path on your computer.
You do not need to be in the same directory as the path. You must enter the
entire path for it to work. For example: cd C:\Windows\System32
driveletter: - This command will take you to the drive letter that you specify.
The drive you specify will need to be active, or have a disc in it if it a CD\DVD
drive. For example, if you want to switch to your D drive, you would enter the
command D:
Page | 57
E-Content of
IT TOOLS AND BUSINESS SYSTEM
exit - This command will exit the Command Prompt, no matter your current
location.
Path setting:
Users can run an executable from windows command prompt either by giving the
absolute path of the file or just by giving the executable file name.
In the latter case, Windows searches for the executable in a list of folders which
is configured in environment variables. These environment variables are as
below.
1. System path
2. User path.
The values of these variables can be checked in system properties( Run
sysdm.cpl from Run or computer properties).
Initially user specific path environment variable will be empty. Users can add
paths of the directories having executables to this variable.
Administrators can modify the system path environment variable.
In Vista, Windows 7 and Windows 8 we can set path from command line using
‗setx‘ command. setx path "%path%;c:\directoryPath"
For example, to add c:\dir1\dir2 to the path variable, we can run the below
command. setx path "%path%;c:\dir1\dir2"
Alternative way is to use Windows resource kit tools ‗pathman.exe‗. Using this
command we can even remove a directory from path variable.
Page | 58
E-Content of
IT TOOLS AND BUSINESS SYSTEM
To remove path from system path environment variable.
Syntax : pathman /rs directoryPath
Page | 59
E-Content of
IT TOOLS AND BUSINESS SYSTEM
Files
Files are logical containers of data that are always present at the leaf level of a
directory tree, i.e., they are the last element of any tree.
A file cannot be a collection of other files or directories and can only contain
data or instructions.
Each file has a set of properties associated with it, such as
Size
Date created
Date accessed
Date modified
Path
File name
File name
Each file is recognized by its filename. Filename has two parts; name and
extension. File naming conventions must be followed while naming a file. A
filename can have a maximum of 8 characters.
Extension identifies the type of the file or the application to which a particular
file belongs. It can be 3 characters long.
Size
Size determines how much space the file is occupying on the disk.
Date created
Data created corresponds to the date when file was created.
Date accessed
Data accessed corresponds to the date when file was last accessed.
Date modified
Data modified corresponds to the date when file was last modified.
Page | 60
E-Content of
IT TOOLS AND BUSINESS SYSTEM
Path
Path specifies the location of file on the disk. It comprises of a series of
predecessor (parent) directories and moves up to the root.
A file has a certain defined structure which depends on its type
Text file
Source file
Object file
Executable file
Text file
Sequence of characters organized into lines.
Source file
Sequence of sub routines and functions each of which is further organized as
declarations followed by executable statements.
Object file
Sequence of bytes organized into blocks understandable by the system's linker
Executable file
Series of code sections that the loader can bring into memory and execute.
Page | 61
E-Content of
IT TOOLS AND BUSINESS SYSTEM
The directory can be viewed as a symbol table that translates file names into
their directory entries.
The operations that can be performed on the directory are:
Search for a file
Find the entry for a particular file.
Create a file
Create new file and add to directory.
Delete a file
Page | 62
E-Content of
IT TOOLS AND BUSINESS SYSTEM
Remove a file when no longer needed.
List a directory
List the files in a directory and the contents of the directory entry for each file
in the list.
Rename a file
Change name of a file as per user‘s request.
Position within the directory may also change.
Traverse the file system
Every directory and every file within a directory structure should be
accessible.
Magnetic tape is the commonest backup device.
Directory Structure
The directory structure is the organization of files into a hierarchy of folders.
It should be stable and scalable; it should not fundamentally change, only be
added to.
Types of directory structure
Single-level directory
Two-level directory
Tree structured directory
Acyclic graph directory
General graph directory
Single-level directory
A single-level directory with file entries for all users contained in the same
directory.
It is the simplest structure of all directories.
All files are in the same directory.
It is easy to support and understand.
Name collision problem - files must have unique names since multiple users
share same directory.
Page | 63
E-Content of
IT TOOLS AND BUSINESS SYSTEM
Even in case of a single user it is difficult to remember all file names and create
files with unique names (the naming problem).
Files are limited in length.
Page | 64
E-Content of
IT TOOLS AND BUSINESS SYSTEM
Tree structured directory
The two-level directory structure can be extended to a tree of arbitrary height.
Tree is the most common directory structure.
Examples of systems supporting tree structure.
MS-DOS
UNIX
A tree has a root directory.
The root contains a set of directories.
A directory contains a set of files and other sub directories.
Each sub directory can further contain a set of files and other sub directories.
Each file has a unique path name.
One bit in each directory entry defines the entry as a file(0) or as a sub
directory(1).
Page | 65
E-Content of
IT TOOLS AND BUSINESS SYSTEM
Path name
A path name is the path from the root, through all the subdirectories, to a
specified file.
Example
In the figure root/spell/mail/prog/obj is a path.
Types of path names can be of two types.
Absolute path name.
Relative path name.
Absolute path name
An absolute path name begins at the root and follows a path down to the
specified file giving the directory names on the path.
Relative path name
A relative path name defines a path from the current directory.
With reference to figure, if the current directory is root/spell/mail, to reference the
file list.
Relative path name: prog/list.
Absolute path name: root/spell/mail/prog/list.
Page | 66
E-Content of
IT TOOLS AND BUSINESS SYSTEM
Page | 67
E-Content of
IT TOOLS AND BUSINESS SYSTEM
Page | 68