Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
My shell-script wrongly called the same log-file twice!
Now I'm not able to get rid of the old one - help?-rw-rw-r-- 1 inst psh 455 Nov 7 14:09 script_log.txt
exitrw-r-- 1 oper psh 19886 Nov 6 15:05 script_log.txtThanx in advance!
Regards
Bard

You can't have two files with the same name. The OS won't allow that. Apparently there are hidden characters in one of the file names. That also happens when the OS seems to not find a file.
To you it looks like the filename is "script_log.txt" but the filename may well be something like "scri^bpt_log.txt"
To remove it, you'll have to use wildcards, something like
rm *.txt
You may have to try different wildcard combinations to finally delete it because you don't know where the hidden character is.
For example, if the hidden character is between the t & x (script_log.t^ext), using *.txt won't work.
Test any wildcard combinations with 'ls' before you use 'rm' to see what other files are found.
ls *.txt might show you files that you don't want deleted. Sometimes you have to rename files to stop them from being effected.

ls -b will show non-printing characters as octal values. This will help you isolate the filename using a pattern, so that you can rename or remove it, as Don explained:
ls -b
myf\002ile.txt myfile.txtls myf?ile.txt
myfile.txtrm myf?ile.txt
A space will not show as an octal value since it is a printing character. Of course, leading or embedded spaces are easy to spot, but a trailing space is harder to see. To check for filenames that end in a space, this works for me:
ll *" "

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |