Compressing/uncompressing files

  1. Extracting a tar.bz2 file
    \framebox{
\texttt{
\textcolor{red}{\bf tar jxvf FILENAME.tar.bz2}
}
}

    This will show you what extracts, and in most cases will be in a sub directory of FILENAME.

  2. Extracting a tar.gz file
    \framebox{
\texttt{
\textcolor{red}{\bf tar zxvf FILENAME.tar.gz}
}
}

  3. Creating a tar.bz2 file
    \framebox{
\texttt{
\textcolor{red}{\bf tar jcvf FILENAME.tar.bz2 dir1 dir2 ...}
}
}

    FILENAME.tar.bz2 is the name of the tar file we wish to create. dir1 and dir2 are the names of the directories and/or files we wish to include in the tar.bz2 archive.

    To use gzip compression instead of bz2, simply put zcvf in place of jcvf in the command line

  4. Extracting a .rar file
    \framebox{
\texttt{
\textcolor{red}{\bf unrar x FILENAME.rar}
}
}

    you may need to install unrar first using \framebox{
\texttt{
\textcolor{red}{\bf sudo apt-get install unrar}
}
}

  5. Extracting a .zip file
    \framebox{
\texttt{
\textcolor{red}{\bf unzip FILENAME.zip}
}
}

  6. Creating a .zip file
    To create a zip file containing dir1, dir2, ...: \framebox{
\texttt{
\textcolor{red}{\bf zip FILENAME.zip dir1 dir1 ...}
}
}



Webmaster: Christian E. Salas Eljatib, E-mail: christian.salas@yale.edu