- Bash Cookbook
- Ron Brash Ganesh Naik
- 169字
- 2021-07-23 19:17:41
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?
- 計算機(jī)網(wǎng)絡(luò)
- Cocos2D-X權(quán)威指南(第2版)
- The Android Game Developer's Handbook
- Web交互界面設(shè)計與制作(微課版)
- 精通Linux(第2版)
- 前端HTML+CSS修煉之道(視頻同步+直播)
- Building Wireless Sensor Networks Using Arduino
- Visual C#.NET Web應(yīng)用程序設(shè)計
- Learning Node.js for .NET Developers
- HTML5權(quán)威指南
- Raspberry Pi Robotic Projects(Third Edition)
- HTML5+CSS3+jQuery Mobile APP與移動網(wǎng)站設(shè)計從入門到精通
- 零基礎(chǔ)看圖學(xué)ScratchJr:少兒趣味編程(全彩大字版)
- 深度實踐KVM:核心技術(shù)、管理運維、性能優(yōu)化與項目實施
- Angular Design Patterns