← linux commands
Views:
cat command
The cat command is used to show the contents of a file. If given multiple file names, it concatenates the content and then shows it.
Syntax: cat [options] filename
Example:
# To display content of note.txt
cat note.txt

Options:
-n
To show number for each line
Example:
cat -n note.txt

Options:
-b
To show number for each non blank line
Example:
cat -b note.txt

-s
To not show more than one single blank line
Example:
cat -s note.txt

Displaying multiple files at once
# cat file1 file2 ...
cat note1.txt note2.txt

Displaying selective files via wildcard
cat *.config.js
