Cat is a very magical command.
First look at the explanation in Linux:
Linux cat commands are handy for reading short pieces, and if a file is very large, it is convenient to use page commands. Let's look at the actual application of the Linux Cat command.
Usage of Linux cat commands: Viewing files with cat commands:
$ cat test.php;
$ cat-n test.php: Add line number when viewing;
Linux Cat commands can also use wildcard characters: $ cat-n *.php, all php files are displayed (in order to display)
You can also: $ cat-n test.php test1.php test2.php; The result is identical to the output of the wildcard character.
You can combine files with the Linux Cat command and the redirection operator (>):
$ cat *.php > test3.php;
If there are two test.php and test1.php files, how to merge them now. You can use the redirection operator (>>)
$ cat test.php >> test1.php, so that the test.php merged into the back of the test1.php, the integration of the attention to the order, it is not a mistake.
You can use the Cat command to create a new file and enter content directly into the file via the keyboard.
$ cat > myfile.php
Use Ctrl+d to save and exit the file after the input is complete
If the cat and grep commands are used in combination, they will be more invincible.
Look at the example below
There are 1536 lines in the Linux.config file, and imagine how scary it would be if one line of lookup Config_keys, and if you use a combination command
Cat-n Linux.config | The grep Config_keys can be positioned quickly. The-n option is to display line numbers, which you can not use.
Of course, you can also use wildcards to find use. As shown in the above example