What other cat command parameters exist?

The cat command has several parameters (options) that can modify its behavior. Here are some commonly used ones:

  1. -A: Equivalent to -vET, it shows non-printing characters (except for tabs and newlines) and displays $ at the end of each line.

  2. -b: Numbers only non-empty output lines, skipping empty lines.

  3. -e: Equivalent to -vE, it shows non-printing characters and displays $ at the end of each line.

  4. -n: Numbers all output lines, including empty lines.

  5. -s: Suppresses repeated empty output lines, displaying only a single empty line for multiple consecutive empty lines.

  6. -T: Displays tab characters as ^I.

  7. -v: Displays non-printing characters (except for tabs and newlines) in a visible format.

  8. -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.

0 Comments

no data
Be the first to share your comment!