Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The use of text processing tools

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Mastering the use of text processing tools is a very helpful tool for us to view files. It allows us to find what we are looking for faster and better, saving us a lot of time.

File viewing command: cat, tac,rev

Cat [OPTION]... [FILE]...

-E: displays the line Terminator $

-n: number each line displayed

-A: show all control characters

-b: number those that are not blank lines

-s: compress consecutive blank lines into one line

-v view special characters (tab =\ t ^ M =\ r enter = &)

Tac is the opposite of cat. Tac outputs the contents of a file in reverse order.

Rev outputs characters from cat backwards in behavioral units.

More: viewing files in paging

More usage [OPTIONS...] FILE...

-d: displays page turning and exit prompts

(use more to view files, more can only use the d key to flip down and exit, not up and down)

Less: view files or STDIN output page by page

The less command is the pager used by the man command

Using less to view files in paging, you can use pgup to page up or pgdn to page down, but less exits by pressing Q

Head displays the number of lines in front of the text

Head [OPTION]... [FILE]...

-c #: specify the first # bytes to get

-n #: specify the first # line of the fetch

-#: specify the number of rows

Tail displays how many lines of content after the text

Tail [OPTION]... [FILE]...

-c #: specify # bytes after acquisition

-n #: specify # lines after fetch

-#::

-f: track and display the newly appended contents of the file, commonly used log monitoring

{

Tail-n 0-f / var/log/messages &

This command displays only the newly appended content and is executed in the background. It does not occupy the terminal window, only the newly added content is displayed on the terminal.

}

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report