Question

 

Remove duplicate lines from data.txt using uniq.

06 Sep 2025
Answer :
Word Count : 536
In both Windows and Linux lab environments, handling duplicate lines in text files is a common task, especially when dealing with logs, configuration files, or datasets. The `uniq` command is one of the simplest yet powerful utilities available in Linux systems to achieve this. Although it is native to Unix-like systems, similar functionality can also be achieved in Windows when working with Linux shell environments such as Git Bash, Windows Subsystem for Linux (WSL), or through command-line tools available within Cygwin. The main purpose of the `uniq` command is to filter out repeated lines in a file, thereby simplifying the data and making it easier to analyze or process further. When working in a Linux lab, the typical scenario begins with a file named `data.txt` that may contain repeated lines. To remove duplicate lines, the command `uniq data.txt` can be executed. However, one important consideration is that `uniq` only works on consecutive duplicate lines. This means if the duplicate entries are scattered across the file and not directly adjacent to one another, `uniq` will not detect them. Therefore, it is often used in combination with the `sort` command. The usual practice is to
_____ __________ ___ ________ __________ ______ ______ _______ ____.
________ _______ _____ __________ _________.
________ ___ ________ _________ _____ ___ ____.
_____ _______ ___ _________ _________.
________ ________ __________ ________ _________ ___ _____ _______ ____.
__________ _________ _______ _______ _____ ____ ______.
__________ _______ ________ ________ ______ __________ _________ ______ __________ ______ _____ ___.
_____ ________ ______ ________ _____ ________ ___ ____ ________ ___.
__________ _______ ___ ______ ________.
__________ ___ __________ ________ ___ _____ ______.
__________ ____ ________ __________ ___ ___ ______ __________ ____ _____ __________.
____ _______ ___ ________ __________ ________ ____.
_______ _____ __________ ______ ___ ________ _________ _______.
_______ ______ _____ ___ _________ _________ ____ __________ ____ ________ ____ ________.
_____ ______ _________ _________ _________ _______ _____ _________ _______ ___ ____ ______.
______ ____ ______ ___ _________ ____.
_____ ____ ____ ___ _________ ___.
______ ___ ____ ________ _____ _______ __________ _______ ____.
_________ _______ __________ ________ ______ _______ _____ ___ ______.
___ ___ ____ ___ _____ ________ _______ ______ _______ __________.
___ ________ ____ __________ ___ __________.
_______ ________ _______ _____ ________ _______ _____ ________ _____ ___ ________.
____ __________ _____ __________ _________ __________ _____ ________.
____ __________ _____ _____ ______ ______ _________.
__________ __________ ____ ___ __________.
__________ ____ ______ ________ _____ __________ __________ _______ ___ ________.
_________ ________ _______ ___ ________ ______ ______ ___ _____.
_________ _______ ______ _______ _____ _____.
______ ____ _________ ___ ___.
_________ ________ _________ ________ _________ _________.
__________ _____ __________ ________ __________ __________ ______ ___.
_____ _______ _________ _____ _______ _______ _________ ______ ________.
_______ ___ ___ _________ _____ _________ ________ ______ ________ ________.
____ ______ __________ ____ ______ _________ _______ ____ ____ ________ ________ _________.
____ _____ ___ ___ _____ ______ ________.
_______ ____ _____ _________ ___ ___ _____ ___ _______ _______ ____.
______ ___ ______ ___ _________.
________ ________ ___ ______ __________ ____ _____ ________.
_____ ______ ____ ____ _____ ____ __________ _____ ________ ________ _______.
_____ __________ __________ _______ ____ _______ ________ _________ _______ _______ ____ ________.
______ ____ _________ _______ ______ _____ ______ ______ ______ ______ ________.
IGNOU ACADEMY
Your IGNOU journey, made easier.
  • Solved Assignments
  • Study Notes
  • Guess Papers
  • Question Papers
Skip in 10
Top
📞
Call Support Instant phone assistance IGNOU MCSL 204 2025 -  Remove duplicate lines from data.txt using uniq. | IGNOU Academy
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→