Skip to content

TP 3.1: Manipulating archives

Prerequisites

Use your web browser to download fasta data from following url:

https://web-genobioinfo.toulouse.inrae.fr/~formation/unix/tp3/reads.fastq.gz

Transfert this file with Filezilla to genobioinfo at the following path:

~/save/tp_unix/data

Uncompress a file

Question

Move inside the directory data and uncompress the .gz file.

Solution
cd ~/save/tp_unix/data
gunzip reads.fastq.gz

Download a file directly on the server

Question

Alway in the directory data, download with command wget a Swissprot file from http://www.uniprot.org/uniprot/Q96D37.txt

Solution
wget http://www.uniprot.org/uniprot/Q96D37.txt

Compress / Uncompress an archive

Question

Go back inside the directory ~/save/tp_unix.

Archive and compress the directory blast_result.

Display the directory size and its content by using the command du.

Display the archive size.

Solution
cd ~/save/tp_unix
tar -cvzf mon_archive.tgz blast_result
du -csh blast_result
du -sh mon_archive.tgz

Remove a directory and create it again from archive

Question

First, remove the directory blast_result, then uncompress the archive created in previous steps.

Solution
rm -rf blast_result
tar -xvzf mon_archive.tgz