Operating System - HP-UX
1751803 Members
5335 Online
108781 Solutions
New Discussion юеВ

Creating two files with the same name

 
Indrajit Bhagat
Regular Advisor

Creating two files with the same name


ml048-root> ls -lrt
total 32
-rw-r--r-- 1 swbonds iusa 0 Oct 18 20:28 example
-rw-r--r-- 1 swbonds iusa 0 Oct 18 20:28 example


I am just wondering how it get created..I know there is some special character might be used to create this..But I do not know how to decode this.. Please help me out..

8 REPLIES 8
vishnu.khandare
Respected Contributor

Re: Creating two files with the same name

Hi Indrajit,

Please check whts the path where this files created???
Do check the /var/adm/syslog/syslog.log

lastly updates in syslog

Regards
Vishnu Khandare


You should deserve before U desire!!!!
Michal Kapalka (mikap)
Honored Contributor

Re: Creating two files with the same name

hi,

i would check the history file for the command, and also if its possible run the fsck on the file system.

mikap
Hein van den Heuvel
Honored Contributor

Re: Creating two files with the same name

You can use ls -b
"List nonprinting characters in the octal \ddd notation."

Or pipe the ls output in xd.


You Also want to use ls -i to check the inodes.

Hein
Indrajit Bhagat
Regular Advisor

Re: Creating two files with the same name

Hi Experts

I tried to run ls -b which give me below output

$ cd example-for-indrajit
$ ls -b
-c example example\006\017\022\011\016\004\022\001\011\024 wc


But i want to know how we can create this files

In ls -lrt output it is coming like that
$ ls -lrt
total 32
-rw-r--r-- 1 swbonds iusa 0 Oct 18 20:28 example
-rw-r--r-- 1 swbonds iusa 0 Oct 18 20:28 example
-rw-r--r-- 1 root sys 26 Oct 18 21:01 wc
-rw-r--r-- 1 root sys 26 Oct 18 21:01 -c


Please suggest me how this file get created..
merieux
Frequent Advisor

Re: Creating two files with the same name

Hi ,

like you can see your second file example has also non printing character .
It' a mistike of someone or if the file have been created by a script , perhaps mistake is also in the script . ( in this case cat -v help you)


For resolve this issue :
rename example : mv example file1
rename the secondelfile : mv example* file2

Have a good day
likid0
Honored Contributor

Re: Creating two files with the same name

you can also list the inode number of the file:

ls -li

and then delete the file using the inod number with find for example.

you have and example:

http://www.hpuxtips.es/?q=node/207
Windows?, no thanks
TTr
Honored Contributor

Re: Creating two files with the same name

> Please suggest me how this file get created.

I think something went wrong with a command possibly within a script, perhaps the command "wc -c example". It usually happens when trying to remsh or rlogin. The special characters are indicate remote connection control and somehow they became part of the filename.
V. Nyga
Honored Contributor

Re: Creating two files with the same name

Hi,

> Please suggest me how this file get created

I've seen this in an application, where you have to give a file name, then you want to change the name in the input window with backspace or with an arrow key before it's saved.

HTH
V.
*** Say 'Thanks' with Kudos ***