RHEL 7 Cat Command
RHEL 7 Cat Command
Cat :
Option Description
-e Equivalent to -vE.
-t Equivalent to -vT.
if we don’t specify any arguments in the cat command then it will read
the inputs from the keyboard attached to the system. Type some text
after entering the cat command, output will be copy of input provided.
Three files test, file1 and file2 and able to view the contents of
those file as shown above. We need to separate each file with ; (semi
colon).
7 . To copy the contents of one file to another file .When run, the
command requires you to enter the information on the terminal Once
you're done press CTRL+d
cat [filename-whose-contents-is-to-be-copied] > [destination-filename]
8 . -E command line option :To make cat highlight end of lines. The
tool does this by displaying $ at the end of each line. ‘$‘ shows at
the end of line and also in space showing ‘$‘ if there is any gap
between paragraphs. This options is useful to squeeze multiple lines
in a single line.
cat -E [filename]
Using double greater than symbol ‘>>‘ in cat command we can append the
contents of one file to another :
17 .-v option in the cat command :To show the non-printing characters
in the output. This option become useful when we are suspecting the
CRLF ending lines, in that case it will show ^M at the end of each
line.
[root@linuxtechi tmp]# cat -v test_file