SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Maybe I'm making this up, but was there a way to run the command 'cat' safely wihtout accidentally messing up the terminal with garbage characters? I know you can just run 'reset', but was wondering if there was a way to run cat safely.
The terminal can only display printable ASCII characters i.e a-z, 0-9 etc. The garbage is cause by non-printable ASCII characters in the data. Save the data to a file and view it with a hex editor like hexedit. I'm sure there are other methods but this is what I use.
Thanks Alien Bob, that's what I was looking for. The reason being that I wanted to set an alias for cat so that my terminal doesn't get messed up. Just wondering now if this has any bad side effects...
And to clarify, yes, I did mean using cat on binary files. It messes up the terminal in such a way that all normal ascii characters are displayed by weird nonintelligible symbols.
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
In addition to "cat -v" you can use the "strings" utility to safely display an object file's content (useful if you're looking for a pattern in a file).
I used to get that until I made a habit of using 'less' or 'more' instead of 'cat' -unless you are prowling around in /proc, in which case 'cat' is better.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.