Operating System - HP-UX
1833323 Members
2790 Online
110051 Solutions
New Discussion

root system filenames are seen in ascii characters

 
SOLVED
Go to solution

root system filenames are seen in ascii characters

hi all,

filenames in root filesystem is seen in ASCII formats.all other filenames in other filesystem are been seen normally

the ls -l command output is attached .

thanks in advance

regards
Mangesh
12 REPLIES 12
RAC_1
Honored Contributor
Solution

Re: root system filenames are seen in ascii characters

file nsames itself may be like that.
check as follows.

ls -al | vis
ls -bl
ls -al | cat -v

Check if it has any unprintable chars in it or not.
There is no substitute to HARDWORK
Muthukumar_5
Honored Contributor

Re: root system filenames are seen in ascii characters

ls command has an option of b to show non-priting charaters.

Try as,

# ls -bl

hth.
Easy to suggest when don't know about the problem!
Arunvijai_4
Honored Contributor

Re: root system filenames are seen in ascii characters

# man ls says

-b List nonprinting characters in the octal \ddd notation.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
VIKAS AGRAWAL
Frequent Advisor

Re: root system filenames are seen in ascii characters

hi mahesh ,

i have checked your output & found that all files with Junk names are created on the same day , it might be possible that some one ftp some files to root directory with a diff language name.

You can try ls -lb for nonprintable charecters.

I hope there will not be much issue in this

Re: root system filenames are seen in ascii characters

Hi all


thanks for ur response.Pls tell me how shall i remove the files .the o/p of the ls -bl command shows all numeric file names.check the attachment.


regards
Mangesh
VIKAS AGRAWAL
Frequent Advisor

Re: root system filenames are seen in ascii characters

Hi Mangesh ,

u can do it by rm -i *filename*

By this way it will ask for the confirmation of each file to be deleted , or use rm -i * .

Then delete the files with junk name .

It will solve your perpose .

After this close this case & assigne points .
RAC_1
Honored Contributor

Re: root system filenames are seen in ascii characters

Move then with the use of inode number.
ls -abli

note down inode number of files that you want to move.
For every inode do as follows.

find . -inum "number" -exec mv {} new_name \;
There is no substitute to HARDWORK
Arunvijai_4
Honored Contributor

Re: root system filenames are seen in ascii characters

Try using -i option of ls command to find out inode number,

-i For each file, list the inode number in the first column of the report. When used in multicolumn output, the number precedes the file name in each column.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Muthukumar_5
Honored Contributor

Re: root system filenames are seen in ascii characters

Try to remove as,

ls -b | xargs rm -i

will ask your permission of yes / no to remove files in the current directory.

hth.
Easy to suggest when don't know about the problem!
Muthukumar_5
Honored Contributor

Re: root system filenames are seen in ascii characters

Use like,

ls -b | xargs -p -l rm -i

It will ask prompt now :)

hth.
Easy to suggest when don't know about the problem!
Bill Hassell
Honored Contributor

Re: root system filenames are seen in ascii characters

Most of the filenames with "numbers" have non-displayable characters so removing them will be difficult. rm -i works OK except in many cases you can't see the filename reported by rm. For instance, a filename is:

\221k\306

which means that ASCII character 211 (in octal) is followed by "k" then followed by ASCII character 306 (in octal). So you can remove that specific file with this:

rm -i $(echo "\221k\306")

In this case, the echo command will convert the octal numbers back into the equivalent ASCII characters and rm will remove the exact file. This is much safer.


Bill Hassell, sysadmin
Kent Ostby
Honored Contributor

Re: root system filenames are seen in ascii characters

Mangesh --

Do this:

ll -i

This will list the inode numbers in the first column, for example:

27 -rw-rw-r-- 1 hpcu dumps 413 Jul 22 2004 sgtoc
28 -rw-rw-r-- 1 hpcu dumps 180 Jul 22 2004 spinlock.sh
1277 -rw-rw-r-- 1 hpcu dumps 6828 Jul 14 12:22 upgradeOSonly

Then you can run the following command:

find . -inum NUMBER -exec rm {} \;

So if I wanted to remove the file "sgtoc", I'd type:

find . -inum 27 -exec rm {} \;

"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"