12.3 Backing Up, Compressing, and Restoring Files
12.3.5 Restoring files
This section describes the process of restoring the compressed tar file of your home directory that was previously created. Just as tar can combine files to a single archive file, it can also be used to restore them. To restore files in your home directory, perform the following steps:
  1. Make a new directory and change to it. In the home directory, make a new directory and change to it to prevent overwriting files. This will create a separate directory to temporarily hold the restored archived file in.

    $ cd
    $ mkdir newhome
    $ cd newhome
  2. Extract the home directory from tape. The x option extracts the previously tarred file from tape to your current directory (/home/newhome) and the v (verbose) option lets you see the activity as the file is copied. Since no file is specified the home.tar.Z, which is the only file on the tape, file will be copied to the current directory.

    $ tar xv
  3. Uncompress the compressed tar file. Once the file has been copied from tape to the newhome directory, you can uncompress the home.tar file.

    $ uncompress home.tar.Z
  4. Extract the tar file. Once the file has been copied from tape to the newhome directory, you can extract the individual files from the home.tar file.

    $ tar xvf home.tar
  5. Move files as needed. The files in your newhome directory can now be moved to replace those in you real home directory.
Interactive Media Activity (Flash, 95 kB)
  Extracting files with the tar command

In this media activity, you are logged in as user2 and your current working directory is: /home/user2. Refer to the Class File Tree Structure by clicking the 'tree' button located on the Menu Bar and type the commands that would accomplish the requested objectives.
Note: Be sure to press enter after each one. Click on step 1 to begin.