How to use the uniq command: 2-Minute Linux Tips

How to use the uniq command: 2-Minute Linux Tips

Assessment

Interactive Video

Architecture

University

Hard

Created by

Quizizz Content

FREE Resource

The video tutorial explains the use of the 'unique' command in data processing, highlighting its limitations when used with the 'who' command due to differing output lines. It suggests using 'AWK' to reduce data to a single column before sorting and applying 'unique'. The importance of sorting is emphasized, as 'unique' only counts identical lines in succession. The tutorial concludes by demonstrating the '-c' option of 'unique' for counting occurrences.

Read more

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the primary purpose of the 'unique' command?

To create new directories

To summarize and reduce information

To encrypt data

To delete duplicate files

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why is sorting necessary before using the 'unique' command?

To ensure identical lines are in succession

To enhance security

To increase processing speed

To reduce file size

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What tool is used to filter data before passing it to 'unique'?

Grep

AWK

Sed

Find

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the '-c' option do when used with the 'unique' command?

Creates a copy of the output

Counts the occurrences of each line

Compresses the output

Counts the number of unique files

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many users were logged in according to the final output with the '-c' option?

One user logged in twice

Three users logged in

Two users logged in once each

One user logged in once and another twice