- Thread Starter
- #26
john_doe said:
No change:
$ ls
lists the file without problems, while $ ls -l
fails.
Code:
% ls
Vivian?3
% ls -l
ls: Vivian?3: Invalid argument
total 0
% find . -name Viv\*
find: ./Vivian?3: Invalid argument
%
john_doe said:
$ ls
lists the file without problems, while $ ls -l
fails.% ls
Vivian?3
% ls -l
ls: Vivian?3: Invalid argument
total 0
% find . -name Viv\*
find: ./Vivian?3: Invalid argument
%
vrachil said:does
[CMD="echo"]*[/CMD]
print the filename?
% echo *
echo: No match.
%
Yes, it is the only file left in the directory, so I moved to the parent directory and tried.vrachil said:if it is the only file in the directory, try
[CMD="rm"]-rf DIR[/CMD]
% cd ..
% ls
DCIM MISC PRIVATE Pictures Skole
% rm -rf Pictures
rm: Pictures: Directory not empty
%
$ rm -f "Vivian?3"
Carpetsmoker said:~/.Xdefaults
Code:! Use UTF-8 Xterm*locale: UTF-8 ! Set (big) UTF-8 fonts. *VT100.font: -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1
Reload with% xrdb ~/.Xdefaults
Environment:
% setenv LC_CTYPE en_US.UTF-8
I suspect this is a multibyte UTF8 character ...
Regardless, tab completion in TCSH should expand & delete it.
% cat .Xdefaults
! Use UTF-8
Xterm*locale: UTF-8
!
! Set (big) UTF-8 fonts.
*VT100.font: -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1
%
% printenv LC_CTYPE
en_US.UTF-8
%
% rm -f V
rm -f Vivian\?3
rm: Vivian?3: Invalid argument
$ ls -l
$ find
Beastie said:Can you access a machine with Windows installed? You could try to run chkdsk /f on the disk.
magickan said:hmm, any idea how the file came to exist?
you could try removing the file via inode?
eg
ls -i test
426532045 test
find . -inum 426532045 -exec rm -i {} \;
this has worked for me previously on linux assume it will work on freebsd also?
% ls -i
ls: Vivian?3: Invalid argument
%
OH said:What if you try quoting the file to be deleleted
$ rm -f "Vivian?3"
% rm -f "Vivian?3"
rm: Vivian?3: Invalid argument
%
vrachil said:maybe try using quotes with find?
find . -name "Viv*" -exec rm -i {}\;
also, the inode idea seems smart enough to work
% find . -name "Viv*" -exec rm -i {} \;
find: ./Vivian?3: Invalid argument
%
mdhughes said:Have you tried doing an ls -B to get the special characters that are in the file name?
% ls -B
Vivian?3
% ls -b
Vivian?3
%
Like the name suggests, it checks disks. It replaces the old scandisk from Windows 9x (even though chkdsk already existed back then). The /f switch fixes the errors it finds.sverreh said:What does this command do?
Anyway, I would rather like to find a way of doing this in FreeBSD.
Which will probably not work any better. After all it caused the problem in the first place. But it's just a guess, don't quote me.sverreh said:And if I really get desperate I guess I can insert it in the Macbook again and delete it from there.
Carpetsmoker said:How about% ls | hd
% ls|hd
00000000 56 69 76 69 61 6e 3f 33 0a |Vivian?3.|
00000009
%
Beastie said:Like the name suggests, it checks disks. It replaces the old scandisk from Windows 9x (even though chkdsk already existed back then). The /f switch fixes the errors it finds.
I suggested this because when you have a problem with a product designed by Microsoft (i.e. the FAT filesystem), I think it's always better to try to fix it using their tools, especially when you can't seem to be able to fix it otherwise.
Which will probably not work any better. After all it caused the problem in the first place. But it's just a guess, don't quote me.
magickan said:does
ls -i ../* produce the inode number?
sverre % ls -i ../*
../DCIM:
146432 101_PANA
../MISC:
../PRIVATE:
135168 AVCHD
../Pictures:
ls: Vivian?3: Invalid argument
../Skole:
205824 Hakadal 650240 VGS
sverre %
jb_fvwm2 said:Just guessing, but if you know it is a directory,
can you not cd *into* it, move files out of it,
then change back:
Code:cd .. /bin/rm -rf "tab" (or something that will work)
cd ..
sverre % /bin/rm -rf Pic
sverre % /bin/rm -rf Pictures/
sverre % /bin/rm -rf Pictures/
rm: Pictures/: Directory not empty
sverre %
sverreh said:Another original idea! You guys are bright!
This one gives some output, but I need some help to find out if it helps. I am far outside my comfort zone now. :h
Here we go:
Code:% ls|hd 00000000 56 69 76 69 61 6e 3f 33 0a |Vivian?3.| 00000009 %
As far as I can see from the manpage of hd, this is some kind of hexadecimal representation of the file name. Help to decode this will be appreciated!
# touch Vivian?3
$ hd /tmp/x
00000000 01 14 01 00 0c 00 04 01 2e 00 00 00 02 00 00 00 |................|
00000010 0c 00 04 02 2e 2e 00 00 02 14 01 00 e8 01 08 08 |................|
00000020 56 69 76 69 61 6e [color="Red"]3f[/color] 33 00 aa 85 a0 00 00 00 00 |Vivian[color="Red"]?[/color]3........|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000200
$ rm Vivian\?3
killasmurf86 said:I have way better suggesting
run hd on that directory
I created sample directory X in my /tmp and did# touch Vivian?3
after thatCode:$ hd /tmp/x 00000000 01 14 01 00 0c 00 04 01 2e 00 00 00 02 00 00 00 |................| 00000010 0c 00 04 02 2e 2e 00 00 02 14 01 00 e8 01 08 08 |................| 00000020 56 69 76 69 61 6e [color="Red"]3f[/color] 33 00 aa 85 a0 00 00 00 00 |Vivian[color="Red"]?[/color]3........| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00000200
I think this will be more precise (in case ls interpreted your weird letter as ?)
also did you run that fsck?
BTW this file, that I created I could remove easily$ rm Vivian\?3
/% hd Pictures/
00000000 2e 20 20 20 20 20 20 20 20 20 20 30 00 80 01 97 |. 0....|
00000010 b9 3c 21 00 00 00 fd 9e c1 3c 2f 00 00 00 00 00 |.<!......</.....|
00000020 2e 2e 20 20 20 20 20 20 20 20 20 10 00 80 01 97 |.. .....|
00000030 b9 3c b9 3c 00 00 01 97 b9 3c 00 00 00 00 00 00 |.<.<.....<......|
00000040 e5 2e 00 44 00 53 00 5f 00 53 00 0f 00 cd 74 00 |...D.S._.S....t.|
00000050 6f 00 72 00 65 00 00 00 ff ff 00 00 ff ff ff ff |o.r.e...........|
00000060 e5 53 5f 53 54 4f 7e 31 20 20 20 22 00 8e f3 9e |.S_STO~1 "....|
00000070 c1 3c c1 3c 00 00 f3 9e c1 3c 14 00 04 18 00 00 |.<.<.....<......|
00000080 e5 2e 00 5f 00 2e 00 44 00 53 00 0f 00 a7 5f 00 |..._...D.S...._.|
00000090 53 00 74 00 6f 00 72 00 65 00 00 00 00 00 ff ff |S.t.o.r.e.......|
000000a0 e5 7e 31 20 20 20 20 20 44 53 5f 22 00 af 01 97 |.~1 DS_"....|
000000b0 b9 3c b9 3c 00 00 01 97 b9 3c 30 00 52 00 00 00 |.<.<.....<0.R...|
000000c0 e5 2e 00 6c 00 6f 00 63 00 61 00 0f 00 f7 6c 00 |...l.o.c.a....l.|
000000d0 69 00 7a 00 65 00 64 00 00 00 00 00 ff ff ff ff |i.z.e.d.........|
000000e0 e5 4f 43 41 4c 49 7e 31 20 20 20 22 00 b2 01 97 |.OCALI~1 "....|
000000f0 b9 3c ba 3c 00 00 89 75 e7 36 00 00 00 00 00 00 |.<.<...u.6......|
00000100 e5 53 43 30 30 34 38 34 4a 50 47 20 00 b3 01 97 |.SC00484JPG ....|
00000110 b9 3c bb 3c 00 00 f8 8a 3a 3a f1 06 13 0a 04 00 |.<.<....::......|
00000120 e5 53 43 30 30 34 38 36 4a 50 47 20 00 b7 01 97 |.SC00486JPG ....|
00000130 b9 3c bb 3c 00 00 a1 9a 3d 3a fa 06 7f d5 03 00 |.<.<....=:......|
00000140 e5 46 00 61 00 6c 00 6c 00 73 00 0f 00 b0 6b 00 |.F.a.l.l.s....k.|
00000150 6a 00 65 00 72 00 6d 00 00 00 00 00 ff ff ff ff |j.e.r.m.........|
00000160 e5 41 4c 4c 53 4b 7e 31 20 20 20 10 00 ba 01 97 |.ALLSK~1 .....|
00000170 b9 3c b9 3c 00 00 01 97 b9 3c 02 07 00 00 00 00 |.<.<.....<......|
00000180 e5 79 00 00 00 ff ff ff ff ff ff 0f 00 63 ff ff |.y...........c..|
00000190 ff ff ff ff ff ff ff ff ff ff 00 00 ff ff ff ff |................|
000001a0 e5 69 00 50 00 68 00 6f 00 74 00 0f 00 63 6f 00 |.i.P.h.o.t...co.|
000001b0 20 00 4c 00 69 00 62 00 72 00 00 00 61 00 72 00 | .L.i.b.r...a.r.|
000001c0 e5 50 48 4f 54 4f 7e 31 20 20 20 10 00 4f 0f 97 |.PHOTO~1 ..O..|
000001d0 b9 3c b9 3c 00 00 0f 97 b9 3c 5b 0f 00 00 00 00 |.<.<.....<[.....|
000001e0 e5 50 00 68 00 6f 00 74 00 6f 00 0f 00 73 20 00 |.P.h.o.t.o...s .|
000001f0 42 00 6f 00 6f 00 74 00 68 00 00 00 00 00 ff ff |B.o.o.t.h.......|
00000200 e5 48 4f 54 4f 42 7e 31 20 20 20 10 00 99 2f 98 |.HOTOB~1 .../.|
00000210 b9 3c b9 3c 01 00 2f 98 b9 3c b2 6b 00 00 00 00 |.<.<../..<.k....|
00000220 e5 53 00 70 00 61 00 6e 00 69 00 0f 00 3f 61 00 |.S.p.a.n.i...?a.|
00000230 00 00 ff ff ff ff ff ff ff ff 00 00 ff ff ff ff |................|
00000240 e5 50 41 4e 49 41 20 20 20 20 20 10 00 a4 2f 98 |.PANIA .../.|
00000250 b9 3c b9 3c 01 00 2f 98 b9 3c b4 6b 00 00 00 00 |.<.<../..<.k....|
[color="red"]00000260 41 56 00 69 00 76 00 69 00 61 00 0f 00 bc 6e 00 |AV.i.v.i.a....n.|
00000270 23 f0 33 00 00 00 ff ff ff ff 00 00 ff ff ff ff |#.3.............|[/color]
00000280 56 49 56 49 41 4e 7e 31 20 20 20 10 00 a1 30 98 |VIVIAN~1 ...0.|
00000290 b9 3c b9 3c 01 00 30 98 b9 3c 79 6e 00 00 00 00 |.<.<..0..<yn....|
000002a0 e5 74 00 65 00 72 00 00 00 ff ff 0f 00 8e ff ff |.t.e.r..........|
000002b0 ff ff ff ff ff ff ff ff ff ff 00 00 ff ff ff ff |................|
000002c0 e5 20 00 56 00 69 00 64 00 65 00 0f 00 8e 6f 00 |. .V.i.d.e....o.|
000002d0 20 00 43 00 6f 00 6e 00 76 00 00 00 65 00 72 00 | .C.o.n.v...e.r.|
000002e0 e5 58 00 69 00 6c 00 69 00 73 00 0f 00 8e 6f 00 |.X.i.l.i.s....o.|
000002f0 66 00 74 00 20 00 69 00 50 00 00 00 6f 00 64 00 |f.t. .i.P...o.d.|
00000300 e5 49 4c 49 53 4f 7e 31 20 20 20 10 00 43 31 98 |.ILISO~1 ..C1.|
00000310 b9 3c b9 3c 01 00 31 98 b9 3c 5d 6f 00 00 00 00 |.<.<..1..<]o....|
00000320 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00008000
/%
rm -r \xxx\yyy\zzz
It should work. At least as i remember i could open my wrong-encoding-named file with that.rm -r \xxx\yyy\zzz