You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

NAME

cat - concatenate files and print on the standard output

SYNOPSIS

cat [OPTION] [FILE...]

DESCRIPTION

Concatenate FILE(s) and print on the standard output. If FILE is not specified, cat reads its input from the standard input.

OPTIONS

-n

Number all output lines.

EXAMPLES

To display the contents of a file

cat foo.sql

To number all output lines, use:

cat -n foo.sql

To concatenate multiple files and display to the console, use the below command. The contents of the files are not modified or altered.

cat foo1.sql foo2.sql

To concatenate multiple files to a file, use the below command. The contents of the files are not modified or altered

cat foo1.sql foo2.sql >output.sql

To copy a file using cat command

cat foo1.sql >newfile.sql


To use cat command for file creation use the below command. Enter the contents and use Ctrl+C

cat > foo1.sql
  • No labels