- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: When I cat a binary file, I get garbled text.....
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2006 03:04 AM
тАО06-15-2006 03:04 AM
Also, it takes my terminal emulator (exceed) and makes my quick-keys not work.
IE, i have a quick key called nsu that runs a script i run al lthe time....
After I cat the bianry, I push the quickey and get this
nsu^[
It is supposed to be only nsu.
Any ideas?
Thanks,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2006 03:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2006 03:10 AM
тАО06-15-2006 03:10 AM
Re: When I cat a binary file, I get garbled text...
you can use the strings command to view the printable strings in a binary file.
Enrico
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2006 03:11 AM
тАО06-15-2006 03:11 AM
Re: When I cat a binary file, I get garbled text...
Phil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2006 03:11 AM
тАО06-15-2006 03:11 AM
Re: When I cat a binary file, I get garbled text...
Listing binary files with 'cat' or 'more' will often lead to the results you see!
You need to know the internal structure of your binary data in order to read it sensibly.
# 'strings' filename
...will attempt to present the best graphic representation of four or more "printing" characters but will *not* guarantee that you "see" everything.
# od filename
# xd filename
...provide you octal and hexadecimal renditions of your file, respectively.
Should you inadvertantly 'cat' or 'more' a binary file and corrupt your terminal, try:
# stty sane
...This may restore your terminal configuration and avoid the logoff you have been doing.
Lastly, test your files beforehand with:
# file filename
...If you see "ascii", then the file is a "text" file and is safe to 'cat' or 'more'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2006 03:11 AM
тАО06-15-2006 03:11 AM
Re: When I cat a binary file, I get garbled text...
Yea; don't cat binary files. cat is for text files. If you want to see the text (and only the text) in a binary file, use strings...
Doug
------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2006 03:11 AM
тАО06-15-2006 03:11 AM
Re: When I cat a binary file, I get garbled text...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2006 03:13 AM
тАО06-15-2006 03:13 AM
Re: When I cat a binary file, I get garbled text...
Some binary data will be interpreted as control characters - this will confuse your emulation. If you want to "see" your binary file, use "strings" or a hex editor.
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2006 03:15 AM
тАО06-15-2006 03:15 AM
Re: When I cat a binary file, I get garbled text...
Performing a cat of a binary file is one of the more common mistakes. The 'reset' command will reset your terminal to its defaults.
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2006 03:15 AM
тАО06-15-2006 03:15 AM
Re: When I cat a binary file, I get garbled text...
If you really want to look at a binary file use the strings command.
# strings filename | more
This will pull out any "human readable" text. 'man strings' for more information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2006 03:19 AM
тАО06-15-2006 03:19 AM
Re: When I cat a binary file, I get garbled text...
One of the best tools to display these files is hexedit. http://hpux.cs.utah.edu/hppd/hpux/Development/Tools/hexedit-1.2.10/
The standard tools are od and xd. Man od for details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2006 03:23 AM
тАО06-15-2006 03:23 AM
Re: When I cat a binary file, I get garbled text...
The answer I was looking for was the reset command....
It stops the garbled text on the quick keys.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2006 03:25 AM
тАО06-15-2006 03:25 AM