官术网_书友最值得收藏!

How to do it...

Open a terminal and run the following commands:

$ cat loremipsum.txt
$ head loremipsum.txt
$ head -n 1 loremipsum.txt
$ tail loremipsum.txt
$ tail -n 1 loremipsum.txt

Interestingly enough, the tail command has a feature that is different than the head command: it can monitor the tail end of a file forever until the command is exited or killed when using the -f or -F flags. Run the following command:

$ tail -F /var/log/kern.log

Keeping the tail command running, try disconnecting your wireless or Ethernet port. What do you see?

Press Ctrl + C to quit tail and run the following command:

$ more loremipsum.txt

Pressing the spacebar or Enter on your keyboard will progress through the file until the end. Pressing q will immediately exit more and return you to the console prompt.

Next, try the following command:

$ less loremipsum.txt 

Try navigating through the file using pg up, pg dn, the up and down arrow keys, and Enter and the spacebar. Notice anything?

主站蜘蛛池模板: 宝坻区| 秦皇岛市| 会同县| 舒兰市| 北京市| 盐津县| 淄博市| 柘荣县| 灯塔市| 清徐县| 嵩明县| 金山区| 黄山市| 渝中区| 桑植县| 淮安市| 开江县| 开鲁县| 沙洋县| 延安市| 中阳县| 全椒县| 上思县| 务川| 抚宁县| 甘肃省| 嘉兴市| 尉氏县| 邻水| 沙河市| 涞源县| 曲麻莱县| 搜索| 仁怀市| 赣州市| 开封市| 繁峙县| 新建县| 珲春市| 马公市| 抚州市|