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, 2020 in Linux Administration by akhtar
• 38,170 points
74 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, 2020 by MD
• 95,180 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
225 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,890 points
257 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
292 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,130 points
649 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,180 points
7,922 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,180 points
227 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,180 points
132 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,180 points
142 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,180 points
180 views