I'm trying to delete a file with a weird name from within Terminal on a Mac.
It's a very old file (1992) with null characters in the name: ␀␀Word Finder® Plus™.
Here are some examples of what I've tried:
Help appreciated greatly!
cheers,
dp
Last edited by Scrutinizer; 07-18-2019 at 03:21 PM..
Reason: code tags correction
On inspection the two NULL characters that you have shown us are unicode when hexdumped:
Have you tried the GUI dragging the file to the 'Trash' from within Finder, then clearing the Trash?
How about using single quotes instead of double?
How about mv '␀␀Word Finder® Plus™' /tmp/testname in single quotes and let the system remove it during reboot.
Are all the relevant permissions set for YOU to read and write from and to the file?
Remember any of these could cause problems so be very aware.
And finally are you absolutely sure you have the FULL filename and not missing, say, trailing spaces(s)?
That is all I can think of so far...
FWIW, I would solve this by doing exactly what MadeInGermany suggests in post#3 (unless there are so many files in the directory that you would be there all day to do it).
Thanks so much for the prompt ideas. Unfortunately, none have succeeded. I've repeated tried to delete by dragging and always get "The operation can't be completed because an unexpected error occurred (error code -50)." The file is in a folder by itself that I've tried to delete the entire folder, but that won't work either.
Latest attempts:
Single quotes
Throughout, the little bugger is still there. No trailing spaces present. I find it interesting to see the unicode characters wisecracker revealed. Does anyone know how to use that information to identify a file to delete?
Shell script logic
Hi
I have 2 input files like with file 1 content as (file1)
"BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt
File 2 contents as fle(2)
"BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt
I want to get... (22 Replies)
Hi,
I need to compare 2 text files with around 60000 rows and 1 column. I need to compare these and write the mismatch data to 3rd file.
File1 - file2 = file3
wc -l file1.txt
58112
wc -l file2.txt
55260
head -5 file1.txt
101214200123
101214700300
101250030067
101214100500... (10 Replies)
Hi Friends,
I'm a great fan of this forum... it has helped me tone my skills in shell scripting. I have a challenge here, which I'm sure you guys would help me in achieving...
File A has a list of job ids and I need to compare this with the File B (*.log) and File C (extend *.log) and copy... (6 Replies)
I've some files created by a script.
For some reason last time the script run was interrupted for an error and the files produced by the script are undeletable.
i've tryed as root with command 'rm' and even if i got no error in command execution the files are still there.
These are the... (9 Replies)
when i try to ls -lrt the directory, the "undeletable" file is listed.
but when i try to ls -lrt *exe, the "undeletable" file is not listed.
this "undeletable" is the file that i want to delete from the directory.
but when i try to delete/rename/copy.... it, it show that "No such file or... (10 Replies)