Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1
-q  or  —brief—Outputs  only    whether the files   differ
-l or —paginate—Passes the output through pr to paginate it

Finding Similarities in Files with comm


The comm command compares files line by line and outputs any lines that are
identical. For example, this command displays output in three columns, where
column 1 shows lines only in file1, column 2 shows lines only in file2,
and column 3 shows every line that is the same between the two files:


Click here to view code image
matthew@seymour:~$ comm file1 file2


This is a much more detailed comparison than with diff, and the output can
be overwhelming when all you want is to find or check for one or two simple
changes. However, it can be incredibly useful when you aren’t terribly
familiar with either file and want to see how they compare.


There are fewer options available when running comm. These three are the
ones you are most likely to be interested in:


-1—Suppresses   the output  of  column  1
-2—Suppresses the output of column 2
-3—Suppresses the output of column 3

Limiting Resource Use and Job Control


Computer systems run many processes at the same time. This is a good thing
and allows users to multitask. Some processes require more system resources
than others. Occasionally, a resource-intensive process may take up or require
so many resources that it slows down the system for other processes. There
are ways to deal with this. This section describes a few of the basics. You
must have admin privileges to perform any of the actions in this section.


Listing Processes with ps


The ps command lists processes and gives you an extraordinary amount of
control over its operation. A process is any running program or instance of a
running program. There can be many copies of the same program running at
the same time, and when that happens, each has its own process. Every

Free download pdf