Skip to content

cat

concatenate file(s) and print on standard output.

Terminal window
# Display contexts of a file
cat test.txt
# Create a new file
cat >filename.txt
> some content
> ctrl+d
# File contents in reverse order
tac filename.txt
# Append the content of multiple files, into a already existin file
cat first.txt second.txt >> full.txt
# Create new file with EOF
cat >filename.txt <<EOF
> some text
> EOF
OptionsDescription
-nShow Line numbers
-eShows non-printing characters and ends lines with $
-sDisplays non-printing characters, except for tabs and end-of-line characters.
-ADisplay All characters

NA