The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
spaces in filenames Bab00shka Shell Programming and Scripting 8 09-30-2008 02:13 PM
prefixing filenames ravi raj kumar Shell Programming and Scripting 2 11-20-2007 06:17 AM
spaces in filenames, for do naviztirf Shell Programming and Scripting 4 10-17-2007 05:08 PM
spaces in filenames Hitori Shell Programming and Scripting 4 07-04-2006 04:35 PM
how to grep all the filenames in a script newbie168 Shell Programming and Scripting 10 02-13-2006 02:15 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-14-2007
dangral dangral is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2002
Posts: 699
tar contains duplicate filenames

I have a problem where tar is somehow creating duplicate filenames when tarring a directory. Doing an ls on the directory does not show any duplicate filenames, yet when the directory is tarred, you can see that there are duplicates:

Code:
bash-2.03# pwd
/var/log/cricket
bash-2.03# ls -1 | sort | uniq -d
bash-2.03# tar cvf /tmp/ctar.tar . >/dev/null
bash-2.03# tar tvf /tmp/ctar.tar | awk '{ print $NF }' | sort | uniq -d
./cricket24b.10
./cricket24b.79
bash-2.03# tar tvf /tmp/ctar.tar | grep ./cricket24b.10
-rw-r--r--   0/1    13328 Mar 13 01:42 2007 ./cricket24b.100
-rw-r--r--   0/1    13330 Mar 14 09:42 2007 ./cricket24b.10
-rw-r--r--   0/1    13331 Mar 14 09:57 2007 ./cricket24b.10
bash-2.03# ls -l /var/log/cricket/cricket24b.10
-rw-r--r--   1 root     other      13331 Mar 14 09:57 /var/log/cricket/cricket24b.10
bash-2.03# date
Wed Mar 14 12:30:11 EDT 2007
  #2 (permalink)  
Old 03-14-2007
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,717
Are there hard links?
  #3 (permalink)  
Old 03-14-2007
sb008 sb008 is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 384
Quote:
Originally Posted by jim mcnamara
Are there hard links?
There are no hard links, at least not for this specific file

-rw-r--r-- 1 root other 13331 Mar 14 09:57 /var/log/cricket/cricket24b.10

The link count=1

Are you really suie we are dealing with duplicate file names?

It could be that 1 file actually has the name as you see it. The other one could contain non printable characters in its name, which makes it look as if the file has the same name.


You could try the command:

Code:
ls -l /var/log/cricket | grep "Mar 14 09:"
and see if it looks like duplicate names pop up.

If this is the case you can try the command:

Code:
ls -lb /var/log/cricket | grep "Mar 14 09:"
which should show the file names actually differ.

This is all assuming the time stamps of the files haven't changed.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:12 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0