|
|
|
|
Computer Systems
eXercise #8
Operating System Activities
Presented in the following page are practical exercises that use some
commands from two common operating systems: MSDOS
and LINUX.
Some of the most commonly used (and therefore useful) commands are
covered here.
MS-DOS
The following exercises assume you have access to the DOS prompt...
should you be unable to complete these exercises on your own machine,
you will need to arrange access to a DOS computer in Computer Lab 4.8
In most cases, the request (ie. what is required of you) is presented
first followed by a possible solution (in brackets). The tasks are designed
to be completed IN ORDER as their effects are designed to be accumulative.
The activities that follow are designed to give you first hand experience
with INTERNAL and EXTERNAL MS-DOS commands. You are instructed to try
the commands given. You will need a blank DATA DISK, as most activities
will be involving files that reside on them. DO THESE IN THE ORDER SPECIFIED!
If Unsure, ASK for assistance.
- BOOT your computer, and drop through the menu system to dos, to
the ROOT directory of the C: drive - check the DOS version (ver).
- FORMAT your data disk as a system disk with the volume name set
to FRED and report the capacity of the disk. (format a: /s /v:FRED)
- REBOOT your computer with your datadisk in the drive to test you
have created a system bootable disk, report what you are prompted
for on boot.
- Perform a Directory of your disk, and report the name and file size
of the file present in the normal listing.
- Perform a Dir a:\ /a:s, and report any files that appear, along
with their sizes in bytes (a system attribute listing)
- REBOOT your computer without your disk in the drive, then drop through
to the ROOT directory of the c: drive and replace your disk in the
floppy drive.
- LOG to the a: drive, and report the prompt displayed.
- From the a: drive, request a wide directory listing of the \gtsys
directory - a sub-directory of the c: drive (dir c:\gtsys /w) and
report the number of files, the amount of storage used by that sub-directory,
and the remaining space on the disk.
- While logged to the ROOT directory of the a: drive, perform the
following directory request and report its action: (dir c:\ /p)
- create a directory on your disk called IPT (md IPT). Perform a directory
of the drive to confirm the presence.
- Change to the IPT directory on your disk and report the prompt (cd
ipt).
- Perform a normal directory listing and report the information displayed.
Perform the following directory requests and report their outcomes:
(dir .) and (dir ..)
- While logged to your IPT directory, COPY all of the files from the
HDM directory (a sub-directory of the c: drive) into the IPT sub-directory
of your disk (copy c:\hdm\*.*) and report the number of files that
were copied.
- Log back to the ROOT of the a: drive
- Drag copies of all files that start with 'HDM' from the IPT subdirectory
to the ROOT of the a: drive (copy \ipt\hdm*.*) and report the number
of files that were transferred.
- Log to the ROOT directory of the c: drive, then create a directory
called HOMEWORK as a branch of the IPT directory (md a:\ipt\homework)
- COPY all files in the ROOT directory of the A: drive into the HOMEWORK
sub-directory just created (copy a:\. a:\ipt\homework)
- LOG to the ROOT directory of the a: drive, and make a subdirectory
called USER, then log to it
- Report the command you would use to empty the HOMEWORK directory
from where you are (ie. in a:\USER), then try it to check it works
(verify with a dir of the now empty directory).
- Whilst still logged to the USER directory COPY all .com files that
are in the ROOT directory of the c: drive to the HOMEWORK directory,
and report the command you used (be sure to check it has worked)
- Use the following command: copy con a:\test.txt to create a text
file with the words:
the hills are alive with the sound of mucous
press enter at the end of each line. Finish the file with a Ctrl-Z,
Enter to return to the DOS prompt
- Verify the file test.txt exists by issuing the command: type a:\test.txt.
- Report the size of the file, in bytes, from a directory listing.
- Log to the USER directory on your disk and RENAME the copy of command.com
that is now in your HOMEWORK directory to the name albatros.man. Report
the command you used
- Report the actions of the following internal commands:
- Log to the ROOT directory of your a: drive, and report the actions
of the following external commands:
- tree
- tree /f
- mem
- mem /p
- chkdsk
- mode
- Issue the following commands, and report their actions:
- prompt $t
- prompt $d
- prompt $p
- prompt $v$n
- prompt $g
- prompt Yes Master $n
- prompt $t $p $n
- Issue the following command:
sort /+1 <; a:\test.txt >; a:\junk.txt
then type a:\junk.txt and report the effect of the command.
- Issue the following command:
sort /r/+3 <; a:\test.txt >; a:\junk2.txt
then type a:\junk2.txt and report the effect of the command.
- Issue the following command:
find /n "the" a:\test.txt a:\junk.txt
and report the effect of the command.
- Issue the following command:
find /n "albatross" a:\test.txt
and report the effect of the command
- Issue the command:
the albatross did not signify
and report the effect
- Re-format your data disk as a 1.44Mb non-systems disk with your
surname as the volume name
UNIX
The activities that follow are designed to give you first hand experience
with some simple Linux-UNIX commands. You are instructed to try the
commands given AFTER your teacher has established network connection
for you. If Unsure, ASK for assistance.
- Make sure you gain access to the root directory (type pwd [enter]
to print the working directory name - it will be the root /)
- Perform directory listing requests using the following commands
noting the resultant effects of the switches: ls ls -l Examine the
long listing (ls-l) to discover file privileges (d=directory, x=executable,
r=read, w=write access)
- Log to the tutorial directory (cd /tutorial) and pwd to check that
you have arrived correctly
- Perform a wide directory listing (ls) and a wide directory listing
of tutorials' immediate ancestor (ls ..)
- log to the users directory, a sub-directory of the tutorial directory
(cd /users) and create a directory called your surname (mkdir moncrieff
for example) then log to your own directory. pwd to convince yourself
you have arrived
- View the contents of the file julieandrews.text that resides in
the tutorial directory without logging there (cat /tutorial/julieandrews.text)
or (cat ../../julieandrews.text)
- Drag a copy of julieandrews.text into your currently logged directory
(cp ../../julieandrews.text)
- Rename your copy of julieandrews.text to sound1 using a variation
on the move (mv) command (mv julieandrews.txt sound1)
- Drag a copy of floyd.lyrics from the users directory which is a
sub-directory of the tutorial directory (cp /tutorial/users/floyd.lyrics
.) or (cp ../floyd.lyrics .)
- Create a third file in your directory called junk that contains
the contents of both sound.music and floyd.lyrics (cat sound1 floyd.lyrics
>; junk) Then display the contents of the new file on the screen
(cat junk)
- Delete junk (rm junk)
- Copy the file sound1 to the file sound2 (cp sound1 sound2)
- Edit the file sound2 using the line editor (ed sound2[enter] then
type 5s/music/mucous[enter] to search line 5 for the word 'music'
and replace it with the word 'mucous', press w[enter] to save the
file, then press q[enter] to quit the editor). cat sound2 to check
the change has been made
- Find all differences between the two files sound1 and sound2 (diff
sound1 sound2)
- Count the number of words in the file floyd.lyrics by trying: wc
floyd.lyrics wc -w floyd.lyrics wc -l floyd.lyrics
- Find all lines in the file floyd.lyrics that contain the word 'time'
(grep 'time' floyd.lyrics)
- Display the first 4 lines of floyd.lyrics (head -4 floyd.lyrics)
on the screen, then display the last 5 lines of the same file (tail
-5 floyd.lyrics) on the screen
- Arrange the lines of the floyd.lyrics in alphabetical order, displaying
the result on the screen (sort floyd.lyrics)
- Determine the free disk space (1 block = 512 bytes) by using df
- Ask unix for a current calendar (cal), and then a specific calendar
(cal 1 1984 gives january'84 for example - try your birthmonth and
year)
- Ask Linux who is currently logged on the system (who), then ask
the system what the date is (date)
- Empty your directory of all files (rm *) and then log back to the
root (cd /) then delete your users directory (rmdir /tutorial/users/moncrieff)
before asking your teacher to shut down the system.
|
|
|
|
|
|
|