Corning Community College
CSCS1730 UNIX/Linux Fundamentals
Reference technical documentation to locate and operate particular tools to aid you in accomplishing a task. Collaboratively construct an informative document to detail how one can prepare to start upon this process.
To successfully accomplish/perform this project, the listed resources/experiences need to be consulted/achieved:
As part of this activity is to test your ability to navigate around the filesystem and manipulate files on your own, there is no grabit configured for this project.
You will want to go here to edit and fill in the various sections of the document:
It would be especially useful to review the manual pages or any documentation on the following resources:
An archive is where you take multiple files and place them all in the same file. The new archive file would be the same size as if you added all of the sizes from the different files together.If you were to put 7, 10 mb into an archive, the archive would be the size of 50 mb. Tar is a command which does both archiving and a bit of compression.
On an archive you can view the contents, append the contents, extract some of the contents, or 'unpack' all of the contents.
Compression is a technique used to reduce file size.
Short answer: Archiving stores multiple files in one file without changing the size the files take up, compression changes the bit pattern to reduce the size of the file or files.
The two types of compression are referred to as lossy and lossless. Lossy causes data to be lost during the compression process, while lossless techniques of compression allow original data to be reconstructed perfectly from the compressed data when the file is extracted.Hence the names lossy and lossless.
In the UNIX class Public Directory on lab46 you will find a dac0/ subdirectory. You can reach the directory by cd /var/public/fall2023/unix/. Once there use ls to check see if you can find it. Once there enter the dac0 directory and into your the directory with your username. From there you can cp the files, specifying the absolute path to your dac0 (assuming you already made a dac0 directory in where you store your projects) directory in your home directory like ~/src/fall2023/unix/dac0/. Then head to that directory via the same absolute path that you specified and verify all of the files are there with ls.
Next unzip each of the files using tar “-cf file.tar” and “unzip file.zip”
Check each of the text files, some are in English and others you will have to reverse, flip, or decode using the commands in the toolbox above.
Once this is done use the stat “-c %s filename” command to see how big each file is, then rename them in order from smallest to largest with the letters of the alphabet, a being smallest, h being the largest.
You can check the current repository status by using “hg status”
You can add untracked files to your repository by using the “hg add -I -a” command. -I for include pattern -a for “All untracked”
To commit a file, you must use hg commit [file1, file2,…] command with the files that you already added. It will take you to a screen similar to nano or pico editors. Once there you can type a name for your commit and then press enter to accept the name. It will ask if you are sure that you want to save it to a confusing looking name. Press enter and it will return you to the command line. Use hg status to see if you can see any files that you just tried to commit. If you don't see them than your commit will have been successful.
To get your commit actually committed you should use “hg push” to push the file along to be pulled at a later time.
You can pull changes from the server by using the “Hg pull” command.
hg update to update your system after everything has been pulled
On your development system, I want you to do the following:
* Do NOT number your steps. Just place the command-line incantations utilized, one after the other.
One of the tests I will perform for output compliance of your code will involve comparing your program's output against a range of input values, to see if they all output in conformance with project specifications.
I will make use of a checksum to verify exactness.
You will need to run this from your dac0 project directory, where your individual a-h files are located.
You can check your project by typing in the following at the prompt (on lab46):
lab46:~/src/SEMESTER/unix/dac0$ filechk unix dac0
If all aligns, you will see this:
==========unix/dac0 whole file comparison========================================= For the file: a you want: cca000c9cb8a5c134bed61154a7907ba you have: cca000c9cb8a5c134bed61154a7907ba MATCH For the file: b you want: c8136ca761229bad59497021a8f425af you have: c8136ca761229bad59497021a8f425af MATCH For the file: c you want: d6db0da4b084fff4b255ae7a4e95ed62 you have: d6db0da4b084fff4b255ae7a4e95ed62 MATCH For the file: d you want: dadd5272203fa77b80f26cf355e6e833 you have: dadd5272203fa77b80f26cf355e6e833 MATCH For the file: e you want: af095aeaaf55a8a3b351a921baebc9e7 you have: af095aeaaf55a8a3b351a921baebc9e7 MATCH For the file: f you want: 84d0fd81532fac6c743c8054f76f0270 you have: 84d0fd81532fac6c743c8054f76f0270 MATCH For the file: g you want: c36a56a9ab8190e4d007bd16e377639a you have: c36a56a9ab8190e4d007bd16e377639a MATCH For the file: h you want: 226c53b09f112cf7323cd5263302ea95 you have: 226c53b09f112cf7323cd5263302ea95 MATCH
If something is off, your checksum will not match the dac0 checksum, and verification will instead say “MISMATCH”, like follows (note that a mismatched checksum can be anything, and likely not what is seen in this example):
==========unix/dac0 whole file comparison========================================= For the file: a you want: cca000c9cb8a5c134bed61154a7907ba you have: cca000c9cb8a5c134bed61154a7907ba MATCH For the file: b you want: d8136ca761229bad59497021a8f425af you have: c8136ca761229bad59497021a8f425af MISMATCH For the file: c you want: d6db0da4b084fff4b255ae7a4e95ed62 you have: d6db0da4b084fff4b255ae7a4e95ed62 MATCH For the file: d you want: dadd5272203fa77b80f26cf355e6e833 you have: dadd5272203fa77b80f26cf355e6e833 MATCH For the file: e you want: af095aeaaf55a8a3b351a921baebc9e7 you have: af095aeaaf55a8a3b351a921baebc9e7 MATCH For the file: f you want: 84d0fd81532fac6c743c8054f76f0270 you have: 84d0fd81532fac6c743c8054f76f0270 MATCH For the file: g you want: d36a56a9ab8190e4d007bd16e377639a you have: c36a56a9ab8190e4d007bd16e377639a MISMATCH For the file: h you want: 226c53b09f112cf7323cd5263302ea95 you have: 226c53b09f112cf7323cd5263302ea95 MATCH
To be successful in this project, the following criteria (or their equivalent) must be met:
Let's say you have completed work on the project, and are ready to submit, you would do the following:
lab46:~/src/SEMESTER/DESIG/PROJECT$ submit DESIG PROJECT file1 file2 file3 ... fileN
A less abstract instantiation of the above (to help you transition):
lab46:~/src/SEMESTER/unix/dac0$ submit unix dac0 result.tar.gz dac0.steps Submitting unix project "dac0": -> result.tar.gz(OK) -> dac0.steps(OK) SUCCESSFULLY SUBMITTED
You should get some sort of confirmation indicating successful submission if all went according to plan. If not, check for typos and or locational mismatches.
I'll be evaluating the project based on the following criteria:
26:dac0:final tally of results (26/26) *:dac0:archive submitted [2/2] *:dac0:archive has correct name of result.tar.gz [2/2] *:dac0:archive is max compressed with gzip [2/2] *:dac0:archive is a tar archive [2/2] *:dac0:archive extracts into current directory [2/2] *:dac0:archive contains 8 english readable files [2/2] *:dac0:archived files are named a-h [2/2] *:dac0:archived files named in order of size [2/2] *:dac0:instructions submitted in text file [2/2] *:dac0:instructions in file named dac0.steps [2/2] *:dac0:dac0.steps contains list of instructions for accomplishing task [2/2] *:dac0:dac0.steps instructions are accurate and correct [2/2] *:dac0:dac0.steps any extra information after hash mark [2/2]