Home > OS >  The difference between the cat and the tail -f
The difference between the cat and the tail -f

Time:10-06

A, tail

Function: according to the specified file after several rows,
Grammar: tail [+/- num]] [parameter file
In the tail is the meaning of each option:
Line from the first num + num later start, according to
- num from end-of-file num lines began to show, if you omit num parameters, system default is 10,
L num counting unit in text behavior, and parameter option + num or num option when used at the same time, the num said to display text line number,
C in bytes for the num of counting unit, and parameter option + num or num option when used at the same time, the num is said to show the number of characters,
(l, c option can be omitted, the default value for l, namely according to the row count),
Using tail -f option can easily refer to the log files are changing, tail -f filename will put the content at the end of the filename in the display on the screen, and not only refresh, allows you to see the latest file content,

Second, the cat

The cat has three main functions:
1. Display the entire file at a time,
$cat filename
(2) from the keyboard to create a file,
$cat & gt; Filename
Can create a new file, can't edit existing files.
3. To several files into one file,

  • Related