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

Navigating text files with less

Throughout this book, you will often use programs and tools that use the program less or a less-like navigation to view and read file content or display output. At first, the control can seem a bit unintuitive .Here, in this recipe, we will show you the basics of how to navigate through a file using less controls.

Getting ready

To complete this recipe, you will require a working installation of the CentOS 7 operating system with root privileges.

How to do it...

  1. To begin, log in as root and type the following command to open a program that uses less for navigation:
    man man
    
  2. To navigate, press the up and down key to scroll up and down one line at a time, the spacebar to scroll down a page, and the b key to scroll up a page. You can search within the text using the forward slash key, /,followed by the search term, then press Return to search. Press n to jump to the next search result. Press the q key to exit.

How it works...

Here, in this short recipe, we have shown you the very basics of less navigation, which is essential for reading man pages and is used by a lot of other programs throughout this book to display text. We only showed you the basic commands and there is much more to learn. Please read the less manual to find out more on man less command.

主站蜘蛛池模板: 广元市| 拉萨市| 临桂县| 历史| 井研县| 广州市| 莱西市| 朔州市| 成武县| 全南县| 新绛县| 秦安县| 曲松县| 郴州市| 晋江市| 禄丰县| 凉城县| 获嘉县| 清苑县| 宜章县| 吴堡县| 涡阳县| 申扎县| 东海县| 彭泽县| 新化县| 清水县| 开阳县| 眉山市| 偃师市| 修文县| 肥城市| 阳新县| 兖州市| 常德市| 博兴县| 大石桥市| 上蔡县| 泽普县| 固原市| 蓬溪县|