To display end-of-line characters using the cat command, you can use the -E option. This option will add a dollar sign ($) at the end of each line in the output, making it clear where each line ends.
Example:
Here’s how to use it:
cat -E filename.txt
Explanation:
- Replace
filename.txtwith the name of the file you want to display. - The
-Eoption will show a$at the end of each line.
Sample Output:
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.$
This makes it easy to identify the end of each line, which can be particularly useful for troubleshooting formatting issues or trailing spaces.
