Select unique lines along with their count in Linux

0 votes

Hi Team,

I have lots of entries in a file. I want to find unique entries along with the count. How can I find that?

Oct 20, 2020 in Linux Administration by akhtar
• 38,260 points
623 views

1 answer to this question.

0 votes

Hi@akhtar,

You can find the unique entries from a file with the help of uniq command. This command is available in your Linux system

$ cat nums.txt | uniq -c

Here flag -c is used to count the entries.

Hope this answer help you.

To learn more about Linux, enroll in Linux administration course online today.

Thanks.

answered Oct 20, 2020 by MD
• 95,460 points

Related Questions In Linux Administration

0 votes
1 answer

generating a list of files with their absolute path in Linux

If you find an absolute path to start with, ...READ MORE

answered May 16, 2019 in Linux Administration by Upasana
• 8,620 points
1,376 views
0 votes
1 answer

How to find the group associated with a user in linux?

To list all the groups groups or to list ...READ MORE

answered Jun 21, 2019 in Linux Administration by DareDev
• 6,890 points
939 views
0 votes
1 answer

How to create nested directories with a single command in linux?

Try this command. mkdir -p /parent_dir/son_dir READ MORE

answered Oct 19, 2020 in Linux Administration by anonymous
• 19,610 points
2,193 views
0 votes
0 answers

How do i select correct active serial port in linux?

I am trying to communicate with a ...READ MORE

Apr 13, 2022 in Linux Administration by Soham
• 9,710 points
564 views
0 votes
1 answer
0 votes
1 answer

What is the difference between ctrl z and ctrl c in command line?

Hi@akhtar, Generally, these two commands are used to ...READ MORE

answered Feb 24, 2020 in Linux Administration by MD
• 95,460 points
47,474 views
0 votes
1 answer

How to break root password in CentOS/RHEL 8?

Hi@akhtar, Reboot the system and interrupt the boot ...READ MORE

answered May 11, 2020 in Linux Administration by MD
• 95,460 points
1,909 views
0 votes
1 answer

error: Putty.exe has been denied access to IP

Hi@akhtar, The error may occur because of firewall. Your ...READ MORE

answered May 28, 2020 in Linux Administration by MD
• 95,460 points
838 views
0 votes
1 answer

How to create one new partition in my hard disk in Linux?

Hi@akhtar, To create new partition you can follow ...READ MORE

answered Apr 7, 2020 in Linux Administration by MD
• 95,460 points
1,180 views
0 votes
1 answer

not able to run netstat-tnlp in Linux.

Hi@akhtar, In Linux system netstat-tnlp command comes from ...READ MORE

answered Apr 16, 2020 in Linux Administration by MD
• 95,460 points
1,088 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP