saad » howto »

Software Architecture and Design

How To: Tar and Zip Files



Your submission of assignments and projects should always take the form of a single file, either a PDF file or a tarball. Tarballs are produced by running the tar command with appropriate arguments. The purpose of this page is to describe how to produce acceptable tarballs.

To produce a tarball, you must first have the tar command installed on your machine. The Ubuntu VM provided for this class already comes prepackaged with tar. So, no setup is necessary.

Naming Conventions

Please adhere to the following naming conventions for your submitted files:

  • For assignments, your submittal should be a single PDF file having the name assignment#.pdf, where # is the number of the assignment.
  • For projects, your submittal should be a single tarball having the name project#.tar.gz, where # is the number of the project.
  • Within a tarball, your files should all reside within a single directory with the name project#.
  • Any source code within a project submittal should be contained within a directory hierarchy that matches your Java package structure. That is, it should be possible to compile and run your code out of the box.
    • For a project to be ready for compilation and running out of the box, it must compile successfully by running javac path/to/ where all dependencies are built-in; hence, submissions should not rely on any build tools such as Maven or Ant.
    • As an example, this Java project will compile and run out of the box.
  • Within your tarball, the name of the project report should be It should be placed at the top level of your directory hierarchy.
  • Within your tarball, the name of the file containing the design study should be It should be placed at the top level of your directory hierarchy.

Tar and Zip Files

Here is how you can create a tarball from within the VM. Within this section, the pound sign ('#') should be replaced by the project number.

1. Create a top-Level directory

# 1.1 Open a command prompt/terminal and navigate to your home directory
cd ~

# 1.2 Create the top-level directory
mkdir project#

2. Copy files into the top-level directory

# NOTE: assuming the following
# The original source code is contained within the ~/src/ directory
# The original project report is located at ~/report.pdf
# The original design study is located at ~/designStudy.pdf    

# 2.1 Copy the source code into top-level directory
cp -r ~/src ~/project#/src

# 2.2 Copy the project report into the ~/project# directory
cp ~/report.pdf ~/project#/

# 2.3 Copy the design study into the ~/project# directory
cp ~/designStudy.pdf ~/project#/

3. Run tar on top-level directory to create a tarball

# Run the tar command to produce a .tar.gz file
tar -zcvf project#.tar.gz ~/project#

4. Submit Tarball on T-Square

Finally, visit T-Square, and submit the tarball for the appropriate assignment.