From e447677562df912b8927ca396fe3646292f1646d Mon Sep 17 00:00:00 2001 From: vottad Date: Fri, 16 Nov 2018 13:39:35 +0000 Subject: [PATCH] Team advanced: added file comm.html git-svn-id: svn+ssh://atelier.inf.usi.ch/home/bevilj/group-1@235 a672b425-5310-4d7a-af5c-997e18724b81 --- site/pages/cmd/advanced/comm.html | 57 +++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 site/pages/cmd/advanced/comm.html diff --git a/site/pages/cmd/advanced/comm.html b/site/pages/cmd/advanced/comm.html new file mode 100644 index 0000000..93baa25 --- /dev/null +++ b/site/pages/cmd/advanced/comm.html @@ -0,0 +1,57 @@ +--- +layout: page +author: Domenico Votta +category-page: advanced +category-title: Advanced commands +tags: compare sorted files +title: comm +--- +The comm is a command that compares two sorted files line by line and writes the output: the lines that are in common and the lines that are unique.
+ +Here we have two files named example1.txt and +example2.txt that contain 5 elements, to test this command:
+ +example1.txt +{% highlight bash linenos %} +Icecream +Chocolate +Cake +Candy +Biscuit +{% endhighlight %} + +example2.txt +{% highlight bash linenos %} +Bread +Chocolate +Tomato +Candy +Pizza +{% endhighlight %} + +The syntax command is: +
comm [flag][file1] [file2]
+ +
+comm example1.txt example2.txt
+Icecream
+    Chocolate
+Cake
+  Tomato
+    Candy
+Biscuit
+  Pizza
+
+ +

The elements of the first file doesn't have the tab.

+

The elements of the second file have one tab.

+

The elements in common have two tabs.

+ +

Flags

+ +