The cat command has several parameters (options) that can modify its behavior. Here are some commonly used ones:
-
-A: Equivalent to-vET, it shows non-printing characters (except for tabs and newlines) and displays$at the end of each line. -
-b: Numbers only non-empty output lines, skipping empty lines. -
-e: Equivalent to-vE, it shows non-printing characters and displays$at the end of each line. -
-n: Numbers all output lines, including empty lines. -
-s: Suppresses repeated empty output lines, displaying only a single empty line for multiple consecutive empty lines. -
-T: Displays tab characters as^I. -
-v: Displays non-printing characters (except for tabs and newlines) in a visible format. -
-h: Suppresses the output of the file name when concatenating multiple files.
These options can be combined to achieve the desired output. For example, you can use cat -n -s filename.txt to number all lines while suppressing repeated empty lines.
