Operating System - HP-UX
1751732 Members
5420 Online
108781 Solutions
New Discussion

Re: Please help!! Display ASCII when use "ls -l" .

 
Atech
Occasional Contributor

Please hlep!! Display ASCII when use " ls -l" .

Hi every body.Please hlep me. I have HP-UX 11.31.I login root it can display text normal.When i use command "ls -l" it display ascii.

what happen ?So i telnet with DOS  . i can use it  text normal everry time.

 

Value of TERM has been set to "vt100".
[root@sewmsdrp:/]#ls -l
total 2658
-rw-r-----   1 root       sys              0 Oct 18 15:24 €lÐG€aHN€i°,[@Nˆ-+ÿñ€+àŠ@‰€õ
-_+-------   1 _--+       _y_            100 J++ 12  2010 .Xa++h-_i+y
-_+-_+-_--   1 _--+       _y_            100 J++  9 20:11 .e|_c
-_+-------   1 _--+       _y_          36571 Ma_ 12  2009 .g-+h--_dc2-_d
d_+|------   3 _--+       _y_             96 Feb  4  2010 .+-zi++a
-_+-_-----   1 _--+       _y_             10 Feb  4  2010 .+-zi++a-+ice+_e
-_--_--_--   1 +-e+ech    e|ceed        1095 J++ 28 15:10 .-_-fi+e
-_+-_--_--   1 _--+       _y_             27 N-+ 24  2010 ._h-_+_
-_+-------   1 _--+       _y_          61038 N-+ 16 16:21 ._h_hi_+-_y
d_+|_-|_-|   2 _--+       _y_           8192 May 30 12:21 .__h
d_+|_-|_-|   6 _--+       _y_           8192 May  6  2009 ._+
d_+|_-|_-|   3 _--+       _--+            96 Se- 11 13:24 ._+a
-_+-_-----   1 _--+       _y_           1059 J++ 30  2009 @
d_+|_+|_-+   2 i+f-_+i|   i+f-_+i|      8192 N-+ 15 17:01 INFORMIXTMP
d_+|_-|---   2 _--+       _y_             96 A+g  4  2009 SD_CDROM

9 REPLIES 9
user001
Frequent Advisor

Re: Please hlep!! Display ASCII when use " ls -l" .

checkout your profile files eg .profile, maybe considering copying over them from a working user. Backup urs first.

Dennis Handly
Acclaimed Contributor

Re: Please help!! Display ASCII when use "ls -l" .

You may have some unprintable chars or escape sequences in your filenames?

Try "ls -l -b".

 

Have you exported LANG and what is its value?

Atech
Occasional Contributor

Re: Please help!! Display ASCII when use "ls -l" .

I can use "ls -l -b" it display text mode.But cann't "ls -l".

I cann't print $LANG  becuase net set.

 

[root@sewmsdrp:/etc]#echo $LANG
sh: LANG: Parameter not set.
[root@sewmsdrp:/etc]#

 

How to use "ls -l" display normal case ?

Steven Schweda
Honored Contributor

Re: Please help!! Display ASCII when use "ls -l" .

 
Dennis Handly
Acclaimed Contributor

Re: Please help!! Display ASCII when use "ls -l" .

>I can use "ls -l -b" it display text mode.

 

This is your solution.  Unless you have non-ASCII chars in your first filename.

I.e. You take the output of ll -b and then you rename each bad name.  Please provide the "ll -b" output.

 

>I can't print $LANG because net set.

 

That's good, the default is American Nerd, ASCII.

Unless you have a different locale, then you need to export LANG to the right locale.

 

>How to use "ls -l" display normal case?

 

What is "normal" to you?  To me it is ASCII.

Atech
Occasional Contributor

Re: Please help!! Display ASCII when use "ls -l" .

I'm Sorry.

I want to know how to fix it. The problem of the command ls-l.
To display a text mode.

How to export LANG in file /etc/profile or not ?

Stephan.
Honored Contributor

Re: Please help!! Display ASCII when use "ls -l" .

Try to read what you get answered - the problem is a file with non-ASCII chars in the name.

 

Provide as asked the output of 'll -b' then someone can tell you which fil to rename and 'ls -l' will work again correct.

Bill Hassell
Honored Contributor

Re: Please hlep!! Display ASCII when use " ls -l" .

Your problem is due to a garbage filename, in this case, it is the first file listed. The first file listed must be deleted. Since it contains many special characters, about the only way to delete it is to use rm -i /* which will ask you if you want to delete each filename. You will answer y to the first garbage filename, then type CTRL-C to exit the rm command.

 

The reason that the rest of the filenames are messed up is that special control codes have been found in that bad filename and they have changed the way that your terminal works. The -b option finds these bad codees and displays the equivalent octal value. That prevents these special codes from changing your terminal settings.



Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: Please help!! Display ASCII when use "ls -l" .

>I want to know how to fix it. The problem of the command ll.

 

I've told you how to fix it, you must fix the filename.

 

Or you must learn the terminal escape codes and how to turn off line drawing? mode.  Steven's link may help:

http://ascii-table.com/ansi-escape-sequences-vt-100.php

 

Using "ll -b" will show how you got into this mode and that will help undo it.  Hopefully an echo of the right escape sequence will turn it off.

 

>How to export LANG in file /etc/profile or not?

 

This may only fix if if you aren't using the default locale.

 

>The first file listed must be deleted.

 

Or renamed.

 

>about the only way to delete it is to use rm -i /* which will ask you if you want to delete each filename.

 

"ll -b" may provide the some valid chars you can add to the "rm -i" or mv patterns.

 

>is that special control codes have been found in that bad filename and they have changed the way that your terminal works.

 

Right.