The cat command
Yaser Rahmati | یاسر رحمتی
The cat
command allows us to create single or multiple files, to view the content of a file or to concatenate files and redirect the output to the terminal or files.
The "cat
" stands for 'concatenate.' and it's one of the most frequently used commands in the Linux terminal.
Examples of uses:
To display the content of a file in terminal:
To display the content of multiple files in terminal:
To display all files in current directory with the same filetype:
To display the content of all the files in current directory:
To put the output of a given file into another file:
Append the contents of file1 to file2:
To concatenate two files together in a new file:
Some implementations of cat, with option
-n
, it's possible to show line numbers:
Last updated