- First make sure that your code is sitting in its own subdirectory, e.g.,
in my case, my code is in my
.../array
directory:
[andrewd@pupil] ~/teaching/cpsc102/src/examples/array > ls
Makefile array.h dops* templated/
array.cpp dopdf* non-templated/ yarra.cpp
[andrewd@pupil] ~/teaching/cpsc102/src/examples/array >
- Do a
make clean
to clean up all the *.o
and
executable files (to reduce space):
[andrewd@pupil] ~/teaching/cpsc102/src/examples/array > make clean
rm -f array.o core yarra.o yarra
rm -f *.ps *.pdf
- Change directories to one above the current project directory, e.g.:
[andrewd@pupil] ~/teaching/cpsc102/src/examples/array > cd ..
[andrewd@pupil] ~/teaching/cpsc102/src/examples >
- Create the tar file. The command syntax is:
tar cvf <file.tar> <directory>
where <file.tar>
is the tar file being
created, and <directory>
is the directory
which will get archived (stuffed) into the single tar file. You'll
see a list of a <directory/file>
additions being assembled into the tar file. You will then
have the file <file.tar>
.
[andrewd@pupil] ~/teaching/cpsc102/src/examples > tar cvf array.tar array/
array/array.cpp
array/array.h
array/Makefile
array/yarra.cpp
...
- Compress the tar file using
gzip
:
[andrewd@pupil] ~/teaching/cpsc102/src/examples > gzip array.tar
You'll now see the file <file.tar.gz>
.
This is the file you want to submit electronically.