![]() |
CS1101: Laboratory 3bWrapping-up UNIX BasicsAcademic Year 2006-2007Lecturer: Dr. Barry O'SullivanDepartment of Computer Science University College Cork |
To familarise students with the basis UNIX commands for managing files and directories.
The commands in Table 1 may be useful for completing the tasks listed below. If you need to view documentation on any command, simply type the following at the unix command prompt:
man <command name>For example, to get help on the
cp
command, type:
man cpHere are the commands you may need:
Command | What it does |
---|---|
cd
|
moves you to another directory |
pwd
|
tells you which directory you are in |
mkdir
|
creates a directory |
rmdir
|
removes a directory |
ls
|
lists the contents of a directory |
ls -l
|
lists the contents of a directory (long version) |
vi or elvis
|
edit/create a file |
cp
|
copies a file/directory |
mv
|
moves/renames a file/directory |
rm
|
removes a file/directory |
file
|
check the type of a file |
more
|
view the contents of a file by page |
Table 1: UNIX commands which may be useful during this laboratory.
You should complete the following tasks. The result will be a directory structure similar to the one presented in Figure 1, except where otherwise noted. Please also ensure that you can answer all questions on UNIX commands from the past exam papers once you've finished this exercise.
cs1100
, cs1102
and cs1101
;
cs1101
is your current directory;
labs
and reports
;
labs
create a file called
myFirstFile.txt
;
myFirstFile.txt
and call it
myFirstFile.copy
;
myFirstFile.txt
and ensure that it is in the
reports
directory - call it myFirstFile.copy2
;
myFirstFile.copy
that is in the
labs
directory to be mySecondFile.txt
.
This is not illustrated in Figure 1.Figure 1: An illustration of how the directory structure that you are asked to develop should look as you construct it.
Return to the CS1101 Home Page