![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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
|
|
||||
|
Quote:
-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:" If this is the case you can try the command: Code:
ls -lb /var/log/cricket | grep "Mar 14 09:" This is all assuming the time stamps of the files haven't changed. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|