Operating System - HP-UX
1753288 Members
5672 Online
108792 Solutions
New Discussion юеВ

Re: How to view this filename?

 
SOLVED
Go to solution
Vijaya Kumar_3
Respected Contributor

How to view this filename?

Hi all,

How can I view a filename which is having some special characters?

2156 14 -rwxr-xr-x 1 42637 30765 6636 Dec 15 2003

Is there any option that will print the special characters of filenames (with ls command)...

Thanks
Vijay
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
7 REPLIES 7
Devender Khatana
Honored Contributor

Re: How to view this filename?

Hi Vijay,

There is no such option. Atleast one of the characters in the file name should be printable, then using wild characters you can print that file name. For ex. your file name is null7null then using "ls -l *7*" you can print that file using ls command which can list other files as well allthough.

But be careful while removing these file. Use shell history to view previous command & when your ls command shows exactly the desired file name then repeat last command and replace ls with rm -i to interactively remove such files otherwise wild characters can cause disasterous results.

HTH,
Devender
Impossible itself mentions "I m possible"
Kasper Hedensted
Trusted Contributor
Solution

Re: How to view this filename?

Hi,

You can use ls with the option "-b" to list nonprinting characters in octal notation.

Cheers,
Joseph Loo
Honored Contributor

Re: How to view this filename?

hi,

have u try this:

# find / -name '* *' -print

regards.
what you do not see does not mean you should not believe
Indira Aramandla
Honored Contributor

Re: How to view this filename?

Hi,

You can use ls -i. This will print the inode number and the file name.

Then you can use find with inum option to find the file od that particular inore number and more the file.

eg :-
ls -i gave the inode number of the file as

12067 NULL>>

find . -inum 12067 -exec more {} \;

IA
Never give up, Keep Trying
Yogeeraj_1
Honored Contributor

Re: How to view this filename?

hi,

you can also access the file from a graphics console

regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Muthukumar_5
Honored Contributor

Re: How to view this filename?

With ls command,

-b, --escape
print octal escapes for nongraphic characters

ls -b or ls --escape

hth.
Easy to suggest when don't know about the problem!
Vijaya Kumar_3
Respected Contributor

Re: How to view this filename?

Thanks..
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com