Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Detecting Windows line breaks / Hex representation

1 view
Skip to first unread message

Thomas Wiedmann

unread,
Dec 4, 2009, 5:15:37 PM12/4/09
to
Hello,

plain text files sometimes are created or edited on different OS, one time
on Windows, another time on Linux/UNIX and thus they are "living" on
different systems.
With a graphical text editor like UltraEdit (on Windows) I can search with
\p particularly for Windows or with \n for Linux/UNIX line breaks or even
switch to the Hex representation to see, whether a line break is 0D 0A or 0A
only.

Which search pattern /... is available (if any) to find Windows line breaks
- with less
- with vi(m)
to see, whether a line break is of Windows and not of Linux/UNIX?

Which command is available (if any) in
- vim
- less
to toggle to the Hex representation of a text file content?

Or else:
- Which command/tool is available for Linux/UNIX consoles
to toggle to the Hex representation of a text file content?


Thomas Wiedmann

Malcolm Dew-Jones

unread,
Dec 4, 2009, 5:57:02 PM12/4/09
to
Thomas Wiedmann (th...@gmx.de) wrote:
: Hello,


: Or else:


: - Which command/tool is available for Linux/UNIX consoles
: to toggle to the Hex representation of a text file content?

To examine the actual contents of a file from the command line
use od. man od shows various options, -a and -c are often most
useful.

od -c your-file | more


0 new messages