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 19 in Linux Administration by akhtar
• 33,120 points
30 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.

answered Oct 19 by MD
• 78,020 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
125 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 20, 2019 in Linux Administration by DareDev
• 6,870 points
205 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 in Linux Administration by anonymous
• 19,570 points
26 views
–1 vote
1 answer

How to get octal file permission in linux?

You can use this: stat -c "%a %n" ...READ MORE

answered Jan 3, 2019 in Linux Administration by Omkar
• 69,030 points
490 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 in Linux Administration by MD
• 78,020 points
2,936 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 in Linux Administration by MD
• 78,020 points
138 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 in Linux Administration by MD
• 78,020 points
95 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 in Linux Administration by MD
• 78,020 points
95 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 in Linux Administration by MD
• 78,020 points
102 views