- 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?
- 深入核心的敏捷開發:ThoughtWorks五大關鍵實踐
- Google Flutter Mobile Development Quick Start Guide
- Facebook Application Development with Graph API Cookbook
- Apache Oozie Essentials
- Node.js 10實戰
- 自己動手寫搜索引擎
- Python機器學習:數據分析與評分卡建模(微課版)
- 機器學習系統:設計和實現
- Visual Basic程序設計教程
- JavaScript+jQuery開發實戰
- Python高效開發實戰:Django、Tornado、Flask、Twisted(第3版)
- Learning Python Design Patterns
- Microsoft Azure Storage Essentials
- 21天學通C++(第5版)
- Couchbase Essentials