Visit Our UNIX and Linux User Community


show duplicates in unix


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers show duplicates in unix
# 1  
Old 11-04-2009
show duplicates in unix

Hi, im a new member. Nice to meet you!

I have a question, if someone could help me, ill really apreciate. It would make my daily work easier. Smilie

i want to make a depth search of files in /log which the first 4 characters duplicate and with .kur extension.

Example:

/log/1/0124_155178.cas
/log/1/0227_155155.kur
/log/1/0227_155911.kur

In this case i would like this on screen:

/log/1/0227_155155.kur
/log/1/0227_155911.kur

im new in unix , ive tried this:

find /log . -name *.kur | uniq -d -w 4

but it dosent seem to work, but if i go into a directory that has duplicates it works with

ls | uniq -d -w 4

Why the first command dosent work?

Sorry for my terrible english, i try my best.

Edit: Sorry i just saw theres a "UNIX for Dummies Questions & Answers" forum. Could someone move this thread there? Thanks in advance.

Last edited by Master00; 11-04-2009 at 06:55 PM.. Reason: wrong forum
# 2  
Old 11-04-2009
no dot in your command.

Code:
find /log -name *.kur | uniq -d -w 4

# 3  
Old 11-05-2009
Thanks for your answer but it dosent work. It stops searching in 10 sec and it gives only 1 result when theres a lot of duplicates in diferent directorys and that result it isnt even duplicated.

if i go directly to a directory that has duplicates with a ls | uniq -d -w 4 works fine. I want to do a complete search in /log.

thanks in advance

---------- Post updated at 07:52 AM ---------- Previous update was at 07:47 AM ----------

Just found what is happening, if i do -w 4 it reads the first 4 characters of the full path. How can i do so it reads the first 4 characters from the file name?

---------- Post updated at 07:54 AM ---------- Previous update was at 07:52 AM ----------

nevermind , i have it. Thanks Smilie
 

Previous Thread | Next Thread
Test Your Knowledge in Computers #378
Difficulty: Medium
AIX was UNIX 03 compliant.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

UNIX scripting for finding duplicates and null records in pk columns

Hi, I have a requirement.for eg: i have a text file with pipe symbol as delimiter(|) with 4 columns a,b,c,d. Here a and b are primary key columns.. i want to process that file to find the duplicates and null values are in primary key columns(a,b) . I want to write the unique records in which... (5 Replies)
Discussion started by: praveenraj.1991
5 Replies

2. Windows & DOS: Issues & Discussions

Unable to show xclock in UNIX for windows

i had tried to run the xclock after i login into my HP UX machine using the C shell in the Services for Unix (Windows) but the xclock does not pop up. Do anyone has the same issue? Do i need to install some X windows package as well? Thanks (1 Reply)
Discussion started by: lchunleo
1 Replies

3. AIX

Duplicates in bootlist

Hello, I'm moving some disks from the rootvg on AIX 5.3. # replacepv hdiskOLD hdiskNEW I have for example hdisk12 and hdisk13 with hd5 (boot) LV and want to move hdisk13 So 1st I'm excluding it from the bootlist: # bootlist -om normal hdisk12 then # replacepv hdisk13... (7 Replies)
Discussion started by: emoubi
7 Replies

4. Emergency UNIX and Linux Support

Removing all the duplicates

i want to remove all the duplictaes in a file.I dont want even a single entry. For the input data: 12345|12|34 12345|13|23 3456|12|90 15670|12|13 12345|10|14 3456|12|13 i need the below data in one file 15670|12|13 and the below data in another file (9 Replies)
Discussion started by: pandeesh
9 Replies

5. Shell Programming and Scripting

Removing duplicates

Hi, I have a file in the below format., test test (10) to to (25) see see (45) and i need the output in the format of test 10 to 25 see 45 Some one help me? (6 Replies)
Discussion started by: imdadulla
6 Replies

6. UNIX for Dummies Questions & Answers

Duplicates

Hi, How to eliminate the duplicate values in unix? I have a excel file which contains duplicate values. Need to use this in a script. Thanks in advance. (3 Replies)
Discussion started by: venkatesht
3 Replies

7. Shell Programming and Scripting

Non Duplicates

I have input file like below. I00789524 0213 5212 D00789524 0213 5212 I00778787 2154 5412 The first two records are same(Duplicates) except I & D in the first character. I want non duplicates(ie. 3rd line) to be output. How can we get this . Can you help. Is there any single AWK or SED... (3 Replies)
Discussion started by: awk_beginner
3 Replies

8. HP-UX

getting duplicates

how to get duplicates in a file containing data in columns using command or scripting? (4 Replies)
Discussion started by: megh
4 Replies

9. Shell Programming and Scripting

how to make VI editor show colors in Unix

Hi, I saw some people's vi editor show different colors on the text according the nature of text when using it. It would be nice if I can see diffrerent colors with my vi editor. Do anybody know how to set it up? I use PowerTermPro program to access unix machine. I tried to use vim editor but... (7 Replies)
Discussion started by: whatisthis
7 Replies

10. UNIX for Dummies Questions & Answers

what command can show calendar in unix system?

what command can show calendar in unix system? (2 Replies)
Discussion started by: kennethchow
2 Replies

Featured Tech Videos