What are common cat command options?

0196

Here are some common options for the cat command:

  1. -n: Number all output lines.

    cat -n filename.txt
  2. -E: Display a dollar sign ($) at the end of each line.

    cat -E filename.txt
  3. -A: Show all non-printing characters (equivalent to -vET).

    cat -A filename.txt
  4. -b: Number non-blank output lines.

    cat -b filename.txt
  5. -s: Suppress repeated empty output lines.

    cat -s filename.txt
  6. -T: Display TAB characters as ^I.

    cat -T filename.txt
  7. -v: Use ^ and M- notation for non-printing characters, except for line feed and TAB.

    cat -v filename.txt

These options can be combined to customize the output according to your needs.

0 Comments

no data
Be the first to share your comment!