Javatpoint Logo
Javatpoint Logo

Linux cat command

The 'cat' command is the most universal and powerful tool. It is considered to be one of the most frequently used commands. It can be used in many types as given below.

Linux cat command: to display file content

The 'cat' command can be used to display the content of a file.



Linux cat Display

In the above snapshot, file 'jtp.txt' is displayed with the help of command "cat jtp.txt".

Note: To display content of multiple files at once, type file names in one single line like "cat file1 file2 file3....

Linux cat command usage

cat > [fileName]To create a file.
cat [oldfile] > [newfile]To copy content from older to new file.
cat [file1 file2 and so on] > [new file name] To concatenate contents of multiple files into one.
cat -n/cat -b [fileName]To display line numbers.
cat -e [fileName]To display $ character at the end of each line.
cat [fileName] <<EOF Used as page end marker.
Next TopicLinux tac

Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


B.Tech / MCA