Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Same file 2 times in a directory

Status
Not open for further replies.

stephnane

Technical User
Jun 25, 2004
34
0
0
FR
result of my "ls -l" :
total 54864
-rwxrwxrwx 1 root staff 60 Nov 06 14:34 STK.SYN
-rwxrwxrwx 1 root staff 30 Nov 06 14:34 STK.FIC
-rwxrwxrwx 1 ftpdev ftpgrp 13746348 Nov 06 14:34 STK.TXT.OLD
drwxrwxrwx 33 adm sys 1536 Nov 07 18:54 BAK
-rwxrwxrwx 1 ftpdev ftpgrp 540 Nov 07 18:59 STKANCIEN.TXT
-rwxrwxrwx 1 ftpdev ftpgrp 76 Nov 07 19:10 REM_old.DAT
-rwxrwxrwx 1 ftpdev ftpgrp 14199809 Nov 13 11:34 STK.TXT
-rw-r----- 1 ftpdev ftpgrp 3134 Nov 21 16:45 MVT.TXT
-rwxrwxrwx 1 ftpdev ftpgrp 6844 Nov 21 17:27 REM_MVT.DAT
-rw-rw---- 1 adm sys 0 Nov 21 18:47 MVT_20061121_184737.BAD
-rw-rw---- 1 adm sys 0 Nov 21 18:49 MVT_20061121_184912.BAD
-rw-rw---- 1 adm sys 0 Nov 22 10:21 MVT_20061122_102020.BAD
-rw-r----- 1 ftpdev ftpgrp 59 Nov 23 09:42 IMG_STOCK.DAT
-rwxrwxrwx 1 ftpdev ftpgrp 59 Nov 23 10:00 IMG_STOCK.DAT


What's the matter with the 2 last files ? One of them (1st with 640 autorisations is un removable
I tried to delete this one (the first is now already deleted) and to get some commands :
{root} #file IMG_STOCK.DAT
IMG_STOCK.DAT: 0653-901 Cannot get file status.
{root} #rm IMG_STOCK.DAT
rm: IMG_STOCK.DAT: A file or directory in the path name does not exist.

What is the matter here ??

Tks
 
Hi

I'd unmount the filesystem and run an fsck against it.

HTH

Kind Regards,
Matthew Bourne
"Find a job you love and never do a day's work in your life.
 
I ran an fsck with FS mounted and he detected no problem.
 
Try it with the -b option of the ls -command. That will display non-printable characters. Two files with the same name are defeinitely not possible. There must be a difference in the two names.

While you are trying to delete this file(s), you can try it with the find command like:

find . -name "*IMG_STOCK.DAT*" -exec rm {} \;

that will remove both files. Be careful

HTH

mad

Advanced Interactive eXecutable
 
Hi,

use the switch 'ls -i' to display the i-nodes of the files
 
Problem is resolved.
ls -b show me nothing more, and the ls -i show me that this file had an i-node number ..
I did a find ./ with the exec option to delete it ... and it works.

Thanks a lot !

Stephane
 
There were probably some spaces at the end of the file name...

ls -b would not have showed them...

you can get the full file names (noY now anymore because you deleted it by inode) by issuing this:

ls *IMG_STOCK*|od -xc



HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top