Linux: Display / Show File Contents (tabs, line breaks, non-printing characters)

terminal-logo-smallI write before guide, howto create file on Linux shell / command line without text editor (with cat command) and this is guick tip howto display / show file contents (tabs, line-breaks, non-printing characters (ASCII control characters: octal 000 – 037)) and display all on Linux shell / command line. This is very useful when you want to know the entire contents of the file.

Example file

I use /tmp/testing.txt example file on this guide. File is created simply with following command:

Show / Display File Contents on Linux Shell / Command Line

Show file content (without tabs, line breaks, non-printing characters)

Output:

Show file content with tabs (without line breaks and non-printing characters)

Tabs are printed as ^I

Output:

Show file content with line breaks (without tabs and non-printing characters)

Line breaks are printed as $

Output:

Show file content with non-printing characters (without tabs and line breaks)

Non-printing characters are printed as ^ or M- plus 100 to 137 ascii character

Output:

Show file content with tabs, line breaks and non-printing characters

Tabs are printed as ^I, Line breaks are printed as $ and Non-printing characters are printed as ^ or M- plus 100 to 137 ascii character

Output:

Share this post

1 Comment

  1. Very interesting, thanks

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">