Solaris 10 - 'ls' green for root user only

Use

mv *??Desktop* brokenfile

Will this remove Desktop as well? Desktop has to stay there.

I think "Desktop" is another file. Try:

mv "$(printf "\e[32m")" brokenfile

or if you don't mind living dangerously:

rm "$(printf "\e[32m")"
1 Like

Exactly, Desktop is separate folder. You guys rocks!

Command

mv "$(printf "\e[32m")" brokenfile

fixed my problem. For any reason there was something without visible name causing that problem. Thank you very much for your help.

I'm glad we were finally able to help you solve your problem.

Note that if you had shown us the exact output from ls -F|od -c :

0000000  033   [   3   2   m  \n   D   e   s   k   t   o   p   /  \n ...

instead of saying you had something like:

0000000 0 3 3   [   3 2 m   \n   D e s k t o p   /   \n

I wouldn't have needed to scratch my head so many times trying to guess at how to specify a way to name the offending file. The extra spaces in the middle of 033 in the output had me doubting my earlier assumptions (even though they turned out to be correct).

The Desktop file wouldn't have been affected by this command as I put two extra question marks before "Desktop" to avoid this issue but I wrongly thought you had a file with embedded new lines.

That simpler one would have work too:

mv ??32m brokenfile 

You might want to try something like:

find / -name "$(printf '*\e*')" > badlist

to see if there are any other filenames on your system containing escape sequences.

Also:

rm *Desktop*

would have deleted just the bad file and left the Desktop directory alone - rm won't remove directories without the proper options. Or you could just do

rm *?Desktop?*

and only files with the string "Desktop" and at least one other character before and after would have been deleted.

No.

The command rm *Desktop* would have absolutely no effect on any filename that does not contain the string Desktop . The file that was causing problems in case was named <esc>[32m where <esc> is a visual representation of the ASCII escape character with octal value 033.

This is why ls -l output was important to diagnose the problem. Just using ls -F|od -c produced output that couldn't reliably be used to determine the name of the offending file (other than by knowing that there was a directory named Desktop that sorted immediately after the name of the offending file (and we couldn't see that from the snippet of od output provided by by the OP).

I know, sorry for that but I am not able to copy and paste from that machine. It is completely separated. Thanks one more time. :b: