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_linux/data
Uncompress a file¶
Question
Move inside the directory data and uncompress the .gz file.
/home/<username>
├── save
│ └── tp_linux
│ ├── blast_result
│ └── data <- go there
| └── reads.fastq.gz <- uncompress this file
└── work
Solution
cd ~/save/tp_linux/datagunzip 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_linux.
-
Archive and compress the directory
blast_result./home/<username> ├── save │ └── tp_linux <- go there │ ├── blast_result <- compress this directory │ └── data └── work -
Display the directory size and its content by using the command
du. -
Display the archive size.
Solution
cd ~/save/tp_linuxtar -cvzf mon_archive.tgz blast_resultdu -csh blast_resultdu -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_resulttar -xvzf mon_archive.tgz