Skip to content

Commit 539b550

Browse files
committed
gzip and tar
1 parent 93d934b commit 539b550

3 files changed

Lines changed: 71 additions & 7 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ bioinformatics subjects:
55

66
### Table of contents
77

8+
* [Introduction to Unix](unix/first_steps.md)
89
* [16s Metabarcoding Analysis](16s.md)
910
* [Whole Metagenome Sequencing](wms.md)
1011
* [Metagenome Assembly](meta_assembly.md)

unix.md renamed to unix/first_steps.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ Change current working directory The cd command will change the current working
124124

125125
`cd ngs_course_data [enter]`
126126

127-
Now use the pwd command to check your location in the directory hierarchy.
127+
Now use the pwd command to check your location in the directory hierarchy.
128+
129+
Change again the directory to `Module_Unix`
128130

129131
**ls**
130132
List the contents of a directory To find out what are the contents of the current directory type **ls** [enter] The ls command lists the contents of your current directory, this includes files and directories You should see that there are several other directories.
@@ -296,12 +298,9 @@ The wildcard * symbol represents a string of any character and of any length.
296298

297299
<p style="text-align: center;">
298300
<a href="http://77.235.253.122/tutorials/wp-content/uploads/2015/06/Unix_exercise12.png"><img class="alignnone size-full wp-image-443" src="http://77.235.253.122/tutorials/wp-content/uploads/2015/06/Unix_exercise12.png" alt="Unix_exercise12" width="865" height="267" /></a>
299-
</p> For more information on Unix command see EMBNet UNIX Quick Guide.  
301+
302+
For more information on Unix command see EMBNet UNIX Quick Guide.  
300303

301304
<h1 style="text-align: center;">
302-
END OF THE MODULE
305+
End of the module
303306
</h1>
304-
305-
<p style="text-align: center;">
306-
<a href="http://77.235.253.122/tutorials/all-courses/"Back to all courses</a>
307-
</p>

unix/fully_walking.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Introduction to Unix (continued)
2+
3+
In this part of the Unix tutorial, you will learn to download files, compress and decompress them, and combining commands
4+
5+
## Download files
6+
7+
`wget` can be used to download files from internet and store them. The following downloads and stores a file called to the current directory.
8+
9+
`wget https://raw.githubusercontent.com/HadrienG/tutorials/master/LICENSE`
10+
11+
will download the file that is located at the above URL on the internet, and put it **in the current directory**. This is the license under which this course is released. Open in and read it if you like!
12+
13+
The `-O` option can be used to change the output file name.
14+
15+
`wget -O GNU_FDL.txt https://raw.githubusercontent.com/HadrienG/tutorials/master/LICENSE`
16+
17+
You can also use wget to download a file list using -i option and giving a text file containing file URLs. The following
18+
19+
```
20+
cat > download-file-list.txt
21+
url_1
22+
url_2
23+
url_3
24+
url_4
25+
[CTRL-C] (to exit cat)
26+
```
27+
28+
`wget -i download-file-list.txt`
29+
30+
## Compressing and decompressing files
31+
32+
### Compressing files with gzip
33+
34+
gzip is a utility for compressing and decompressing individual files. To compress files, use:
35+
36+
`gzip filename`
37+
38+
The filename will be deleted and replaced by a compressed file called filename.gz To reverse the compression process, use:
39+
40+
`gzip -d filename.gz`
41+
42+
Try it on the License you just downloaded!
43+
44+
### Tar archives
45+
46+
Quite often, you don't want to compress just one file, but rather a bunch of them, or a directory.
47+
48+
tar backs up entire directories and files as an archive. An archive is a file that contains other files plus information about them, such as their filename, owner, timestamps, and access permissions. tar does not perform any compression by default.
49+
50+
To create a gzipped disk file tar archive, use
51+
52+
`tar -czvf archivename filenames`
53+
54+
where archivename will usually have a .tar .gz extension
55+
56+
The c option means create, the v option means verbose (output filenames as they are archived), and option f means file.
57+
58+
To list the contents of a gzipped tar archive, use
59+
60+
`tar -tzvf archivename`
61+
62+
To unpack files from a tar archive, use
63+
64+
$ tar -xzvf archivename

0 commit comments

Comments
 (0)