bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cat binary files bug


From: James Youngman
Subject: Re: cat binary files bug
Date: Wed, 6 Jun 2007 13:12:45 +0100

On 6/6/07, Alexander Meyr <address@hidden> wrote:
hi there......

dont know if its a known bug. ill try to describe:

using backtrack v2 final kernel 2.6.20

I have no idea what that is.


problem using cat when input is a executive file like /bin/ls. cat displays
the file and when finished the shell is shown in unreadable characters.


Terminals are controlled by sending special characters to them.
Binary files contain lots of bytes containing all kinds of values,
some of which correspond to control codes that change the state of
your terminal.   Sending those control codes to your terminal by
cating a binary file will change your terminal's state in ways which
you obviously didn't expect.

If you don't want your terminal to change state in odd ways like this,
don't send the contents of a binary file to your terminal.  If you
just want to see what is in the file, use "hexdump -C filename" or
"file filename".  Try reading the manual pages for these two
utilities.

To return your terminal to some kind of normal state after
accidentally sending a binary file to it, you can usually use "reset"
(on GNU/Linux systems) or "tput rs" (on GNU/Linux systems and most
other Unix systems).

James




reply via email to

[Prev in Thread] Current Thread [Next in Thread]