answersLogoWhite

0


Best Answer

You can use the uniq keyword in Linux.

Ex:

Assuming you have a text file test.txt that contains a pipe delimited bunch of data you can use the below command.

cut -f5 -d'|' test.txt | sort | uniq -d

Here 5 is the column which you want to check dupes.

The output of the command would be all the duplicate entries in that column.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can you find duplicate entries in text files in Linux or Unix?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you find files in Linux and Unix?

Linux and Unix and their variants have several different ways of locating files. each of the below commands can be used to locate files.findlocatewheriswhich


How are files hidden in Linux?

Files in unix operating systems with a '.' character as the first character in the filename are hidden.


Where are the C header files in Linux?

The C header files are in the same place as other Unix and Unix-like systems: /usr/include if you installed the compiler.


Is UNIX based on Linux?

No, but Linux is based on Unix since Linux is a Unix clone.


How do you change UNIX server to Linux?

Back up the files to another disk change the os and restore the files.


Is unix and Linux an open system?

Linux is an open system, Unix is not.


Linux and Unix are managed through a series of text files?

Unix / Linux are both file based operating systems. The majority of configuration can be amended by system configuration files, although as the systems have developed more and more of this is automated and hidden from the user. User configuration files will normally reside under the /etc directory.


Mandriva is Linux or unix?

linux


What command is used to Fetch names from a fileName.txt sort them and remove any duplicate entries in Unix?

You could do something like: sort fileName.txt | uniq > newfile.txt


What is the difference between Windows Unix and Linux?

what are similarities and differences between linux and unix?


Is any virus attack to Linux or Unix?

Linux and Unix do have their share of malware, though there are fewer of them.


Does Linux use the kernel of Unix?

No, it is unix-based but Linux is a kernel not an operating system.Ubuntu,Linux Mint,Debian,and puppy Linux,ect. are OS's that use the Linux kernel.