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

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?

主站蜘蛛池模板: 岢岚县| 勐海县| 环江| 长阳| 平武县| 淳化县| 嘉黎县| 咸宁市| 湖州市| 东至县| 南郑县| 沾化县| 红桥区| 贡觉县| 康保县| 巴青县| 西贡区| 仪陇县| 香格里拉县| 衡山县| 怀安县| 怀宁县| 玛沁县| 额尔古纳市| 新邵县| 嘉祥县| 耒阳市| 甘孜县| 申扎县| 日土县| 绥棱县| 芦山县| 沾益县| 温州市| 安徽省| 万年县| 鄄城县| 朝阳市| 莆田市| 通许县| 孟村|