What does the -E option do in the cat command?

The -E option in the cat command is used to display a dollar sign ($) at the end of each line of output. This can be helpful for visualizing line endings, especially when working with files that may have trailing spaces or when you want to confirm the end of each line.

Example:

cat -E filename.txt

If filename.txt contains:

Hello, World!   
This is a test file.  
It has multiple lines.  

The output with the -E option will look like this:

Hello, World!$   
This is a test file.$  
It has multiple lines.$  

In this output, the dollar sign indicates the end of each line, making it easier to see where lines terminate.

0 Comments

no data
Be the first to share your comment!