Department Of Computer Science
Class : PGDCA Ist Sem
Subject : Introduction to Operating System(DOS, Windows, Linux)Practical
LAB MANUAL
Se. No NAME OF PROGRAM
1. How can you create, change, and delete directories in DOS? Describe the use of MD, CD,
and RD commands.
2. Explain how to copy files, rename them, and delete them in DOS. Use the commands
COPY, REN, and DEL.
3. File and Folder Management in Windows XP
4. Windows Accessories
5. Advanced Features of Windows XP
6. Object Linking and Embedding (OLE)
7. Write a syntax and usage the directory management commands with all options
8. Write a command with syntax and usage the file management commands.
9. Write a command with syntax & usage and execute the general purpose
commands.
10. Write a command with syntax & usage and execute using simple filters.
Ex. No: 1 .
Aim/Objective : How can you create, change, and delete directories in DOS? Describe the use of
MD, CD, and RD commands.
Procedure:
In DOS, directories can be managed with the MD (Make Directory), CD (Change Directory), and
RD (Remove Directory) commands.
1. Creating a Directory (MD):
o Command: MD [directory name]
o Description: Creates a new directory with the specified name.
o Example: To create a directory named "Projects":
2. Changing Directory (CD):
Command: CD [directory name]
Description: Changes the current directory to the specified directory.
Example: To move into the "Projects" directory:
3. Removing a Directory (RD):
Command: RD [directory name]
Description: Deletes the specified directory. The directory must be empty before it
can be removed.
Example: To remove the "Projects" directory:
Ex. No: 2 .
Aim/Objective : Explain how to copy files, rename them, and delete them in DOS. Use the
commands COPY, REN, and DEL.
The COPY, REN, and DEL commands in DOS are used to manage files by copying, renaming, and
deleting them, respectively.
1. Copying Files (COPY):
Command: COPY [source file] [destination path]
Description: Copies a file from the source location to the destination location.
Example: To copy [Link] from the current directory to the C:\Documents
folder.
2. Renaming Files (REN):
Command: REN [existing filename] [new filename]
Description: Renames an existing file to a new name.
Example: To rename [Link] to [Link]
3. Deleting Files (DEL):
Command: DEL [filename]
Description: Deletes the specified file.
Example: To delete [Link]
Ex. No: 3.
Aim/Objective : File and Folder Management in Windows XP
a. Navigating Between Folders
Procedure:
Open Windows Explorer by right-clicking the Start button and selecting "Explore."
Use the folder tree on the left to navigate between folders.
b. Manipulating Files and Folders
Actions: Copy, Move, Rename, Delete
Example: Copying a File
Right-click the file > Select "Copy".
Navigate to the destination folder > Right-click > Select "Paste".
c. Creating a New Folder
Procedure: Right-click within the destination directory > Select "New" > "Folder" >
Name the folder as desired.
d. Searching Files and Folders
Procedure:
Click on "Start" > "Search" > Enter the file or folder name > Click "Search".
e. Transferring Files Between Drives
Example:
Open Windows Explorer.
Drag files from one drive (e.g., C:) to another (e.g., D:).
f. Formatting a Floppy Drive
Procedure: Insert the floppy disk > Right-click the drive > Select "Format".
g. Using External Storage Devices
Connect USB, CD, or DVD to the computer.
Access the drive from My Computer to read or write files.
Ex. No: 4.
Aim/Objective : Windows Accessories
a. Using Accessories
1. Calculator: Start > Programs > Accessories > Calculator
2. Notepad: Start > Programs > Accessories > Notepad
3. Paint: Start > Programs > Accessories > Paint
4. WordPad: Start > Programs > Accessories > WordPad
5. Command Prompt: Start > Programs > Accessories > Command Prompt
Ex. No: 5
Aim/Objective : Advanced Features of Windows XP
a. Managing Hardware and Software
Installation Procedure:
Connect the hardware device (e.g., Printer or Scanner).
Go to Control Panel > Add Hardware > Follow the on-screen instructions.
b. Using System Tools
1. Disk Cleanup: Start > Programs > Accessories > System Tools > Disk Cleanup
2. Disk Defragmenter: Start > Programs > Accessories > System Tools > Disk
Defragmenter
3. System Information: Start > Programs > Accessories > System Tools > System
Information
c. Multiple User Features
Creating a New User: Control Panel > User Accounts > "Create a new account" >
Follow the prompts.
Deleting a User: Control Panel > User Accounts > Select user > "Delete the account".
Changing User Password: Control Panel > User Accounts > Select user > "Change the
password".
d. Accessibility Features
Magnifier, Narrator, and On-Screen Keyboard: These are available in Start >
Programs > Accessories > Accessibility.
e. Sharing Folders and Drives
Procedure:
Right-click the folder > Select "Properties" > "Sharing" tab > Enable "Share this folder
on the network".
Ex. No: 6
Aim/Objective : Object Linking and Embedding (OLE)
Objective: Embed or link objects (like Excel or Word files) within other applications.
a. Procedure for Embedding
Open the destination document (e.g., a Word document).
Click "Insert" > "Object" > Choose "Create from File" > Browse and select the file.
Click "OK" to embed the file within the document.
b. Procedure for Linking
Open the source document (e.g., an Excel spreadsheet).
Select the data > Copy (Ctrl + C).
In the destination document, right-click > Select "Paste Special" > "Paste Link" > "OK".
Managing Embedded/Linked Objects:
Embedded objects are part of the destination file, while linked objects are updated from
the source file. Right-click on the object to update or change links.
Ex. No: 7
Aim/Objective : Write a syntax and usage the directory management commands with all options.
Procedure:
Command: ls
Usage : It is used to display the files in the current working directory.
Syntax : ls [Options]
[Options] :
-l - list the files in the long format
-a - list all entries, including the hidden files
-d - list the directory files instead of its contents
-t - lists in order of last modification time
Examples : $ls
Output: list all files in specified directory.
Command: cd
Usage : It is used to Change from the current Working directory to any other
directory Specified.
Syntax : cd [DIRECTORY]
Command: pwd
Usage : It is used to display the full path for the Current working directory.
Syntax : pwd
Example : $pwd
Output :To view the directory path.
Command: mkdir
Usage : It is used to create a new directory.
Syntax : mkdir <directory name>
Example : $mkdir newdir
Output : Creates directory newDir
Command : rmdir
Usage : It is used to remove a directory specified in the command line. It requires
the specified directory to be empty before removing it.
Syntax : rmdir <directory name>
Example: $rmdir newdir
Output : deletes the directory newDir. newDir should be empty
Ex. No: 8
Aim/Objective : Write a command with syntax and usage the file management
commands.
Procedure:
Command : cat
Usage : This command is used to display the contents of a small file on terminal.
Syntax : cat <option> <file name>
Option : -s –Warning about non existing file.
Example: $cat [Link]
Output : To display the content of sample3 text file.
Command : Chmod
Usage : It is used to changing the permissions of the file.
File type: (i) owner (ii) group (iii) others
• Owner has all three permissions.
• Group has read and writes.
• Others have only read permission.
• read permission – 4, write – 2, execute 1
• eg. rwxrwr=764 , 673 = rwrwxwx
Syntax: chmod [OPTION] [MODE] [FILE]
Example: ˜$ chmod o+x [Link]
˜$ ls -l [Link]
Output: -rw-r--r-x 1 srihari srihari 3570 2009-03-23 10:
˜$ chmod 655 [Link]
˜$ ls -l [Link]
Output: -rw-r-xr-x 1 srihari srihari 3570 2009-03-23 10:
Command: cp
Usage : This command is used to create duplicate copies of ordinary files.
Syntax : cp [source file] [destination file]
Example: $cp [Link] [Link]
Output : creates the copy of [Link]
Command: mv
Usage : This command is used to move or rename ordinary files and directories.
Syntax : mv [source file] [destination file]
Example: $mv [Link] [Link]
Output : renames the file [Link] to [Link]
Command: rm
Usage : It is used to remove the specified file in directory.
Syntax : rm [source file]
Example: rm file1
Output : To delete the text file name file1.
Command: more
Usage : This command is used to display the output of a command on the screen
page by Page.
Syntax : more [options] filename
Options : n – skip n lines and display another screen [ n as an integer]
-h displays all the options in more
Example: $more [Link]
Output: To display the output of [Link] in page by page.
FILE COMMANDS:
Command: diff
Usage : This command is used to find difference between two files.
Syntax : diff [options..] from-file to-file
Options : -w Ignore white space when comparing lines.
-a Treat all files as text and compare them line-by-line.
-b Ignore changes in amount of white space.
Example: $ diff -w [Link] [Link]
Command: cmp
Usage : This command is used to compare two files whether they are identical or
not.
• The two files are compared byte by byte and the location of the first mismatch is
printed on the screen.
• If two files are identical, then it does not print anything on the screen.
Syntax : cmp <file1> <file2>
Example: $ cmp [Link] [Link]
Command : cat
Usage : This command is used to when supplied with more than one file will
concatenate the files without any header information.
Syntax : cat <file name>
Example: $ cat [Link] [Link]
Output:
/*contents of [Link]*/
/*followed by contents of [Link]
Ex. No: 9
Aim/Objective : Write a command with syntax & usage and execute the general
purpose commands.
Procedure
Command: wc (statistic of file)
Usage : This command is used to count lines, words and characters, Depending
on the option used.
Syntax : wc [options] [file name]
Options : -l: Number of lines
-w: Number of words
-c: Number of characters
Example : $ wc [Link]
Output : 65 2776 17333 [Link]
Which means [Link] file has 65 lines, 2776 words, and 17333 Characters .
Command: od
Usage : This command is used to display the actual file content on octal value
format.
Syntax: od [option] filename
Example: od -c [Link]
Command: lp
Usage : This command is used to send file to a printer.
Syntax : ip [option] filename
Example : ip sample file
Output : To view the file on printer format.
Command : cal
Usage : This Command is used to see calendar for any specific month or a
complete year
Syntax : cal [ [month] year]
Example: $ cal April 2009
Output : April 2009
Su Mo Tu We Th Fr Sa
1234
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30
Command : date
Usage : This command is used to display the current date.
Syntax : $ date
Options:
d - The day of the month (1-31)
y - The last two digits of the year
H,M,S - Hour Minute and second respectively
D - the date in mm/dd/yy
Example: $ date
Output: Tue Apr 21 [Link] IST 2009
Example: $ date +"%D %H:%M:%S"
Output: 04/21/09 [Link]
Command: who
Usage : This command is used to list the users currently logged on to the
system.
Syntax : $ who
Output:
srihari pts/0 2009-04-15 11:58 (:[Link])
nithin pts/1 2009-04-15 16:09 (:[Link])
avadhut pts/2 2009-04-13 14:39 (:[Link])
anil pts/3 2009-04-13 16:32 (:[Link])
Command : tty
Usage : The Linux "tty" command display the name of the connected terminal.
Syntax : tty [OPTION]...
Example: [root@RHEL01 ~]# tty
Command : ln
Usage : The ln command is used to create link to a file (or) directory. It helps to
provide soft link for desired files.
Syntax : ln [options] existing file (or directory)name new file(or directory)name
Options:
-n - Does not overwrite existing files.
-s - Used to create soft links
Example: ln -s [Link] [Link]
Output : Creates a symbolic link to '[Link]' with the name of '[Link]'.
Ex. No: 10
Aim/Objective : Write a command with syntax & usage and execute using simple filters.
Procedure :
Command : pr
Usage : This command is used to convert text files for printing type.
Syntax : pr [OPTION]... [FILE]...
Example: pr sample file
Output: To view the specified file on printing method.
Command : head
Usage : This command is used to displays the top of the file. When used
without any
option, it will display first 10 lines of the file.
Syntax : $ head –n filename
Example: $ head -n 20 [Link]
Output: /* will display first 20 lines*/
when used without any option it will display first 10 lines of the file .
Command : tail
Usage : The tail command used to displays the end of the file. By Default it will
display last 10 lines of the file
Syntax :$ tail –n filename
Example: $ tail -n 20 [Link]
Output : /* will display last 20 lines*/
when used without any option it will display last 10 lines of the file.
Command : cut
Usage : (cutting columns)
This command can be used to cut the columns from a file with -c option.
Syntax :$ cut -c [numbers delimited by comma or range] <file name>
Option : -f option you can cut the fields delimited by some character.
-d option is used to specify the delimiter and -f option used to specify
the field number.
Example : $ cut -c 1, 2, 3-5 [Link]
Output : 1 ani
2 das
3 shu
4 sin
Example : $ cut -d" " -f1, 4 [Link]
Output : 1 Mtech
2 Btech
3 Mtech
Command : paste
Usage : The paste command will paste the contents of the file side by side
Syntax : $ paste <file1 name> <file2 name>…..<filen name>
Example: $ paste [Link] [Link]
Output: 1 Mtech 1 anil H1
2 Btech 2 dasgupta H4
3 Mtech 3 shukla H7
4 Mtech 4 singhvi H12
5 Btech 5 sumit H13
Command : nl
Usage : It is numbering lines tool, it's default action is to write it's input (either
the
file names given as an argument, or the standard input) to the standard
output.
Syntax : nl [options]... [File]
Option :-h header type
-f footer type
-i increment type
Example: $ samplefile
Command : sort (ordering a file)
Usage : It is used to sort re-orders lines in ASCII collating sequences, white
spaces, then numerals, uppercase and finally lowercase.
Syntax : sort [-options] filename
Options: -r display input taken from the reverse alphabetical order
-f output arranged in alphabetical order
-n arrange the input according to numerical values
Example: $ sort –n [Link]