Slackware This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
08-19-2006, 08:59 AM
|
#1
|
Member
Registered: Aug 2003
Distribution: Slackware
Posts: 72
Rep:
|
cat safely without messed up terminal
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.
|
|
|
08-19-2006, 09:07 AM
|
#2
|
HCL Maintainer
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,941
Rep:
|
I don't understand what you mean by "cat safely" or "garbage characters",
unless you were trying to cat a binary file or something.
Code:
bash-3.1$ cat useful-commands
ldd `which fluxbox`|awk '{print $1}' > fluxlibs
grep -lf fluxlibs /var/log/packages/*
Flux (mine, at least) is linked against libs from following packages:
Code:
/var/log/packages/cxxlibs-6.0.3-i486-1 /var/log/packages/elflibs-9.1.0-i486-2 /var/log/packages/expat-1.95.7-i486-1
/var/log/packages/gcc-3.3.4-i486-1 /var/log/packages/gcc-g++-3.3.4-i486-1 /var/log/packages/x11-6.8.1-i486-3
/var/log/packages/zlib-1.2.2-i486-2
posted by Tinkster in LQ
Could you post an example?
|
|
|
08-19-2006, 09:11 AM
|
#3
|
Moderator
Registered: Aug 2002
Posts: 26,477
|
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.
What are you trying to do?
Last edited by michaelk; 08-19-2006 at 09:14 AM.
|
|
|
08-19-2006, 01:22 PM
|
#4
|
Slackware Contributor
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559
|
|
|
|
08-19-2006, 05:03 PM
|
#5
|
Member
Registered: Aug 2003
Distribution: Slackware
Posts: 72
Original Poster
Rep:
|
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.
|
|
|
08-20-2006, 01:42 PM
|
#6
|
Senior Member
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
|
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).
|
|
|
08-20-2006, 02:54 PM
|
#7
|
Amigo developer
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928
|
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.
|
|
|
All times are GMT -5. The time now is 12:32 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|