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

How does CentOS consult the contents of the file?

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly explains "how CentOS accesses file contents". The explanation content in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian and go deep into it slowly to study and learn "how CentOS accesses file contents" together!

1.cat [-AbEnTv] File path: Displays the specified file as read-only, Parameters:

1)-A: equal to-vET, can list some special characters instead of blank

2)-b: List line numbers, list only line numbers of non-empty hundred lines

3)-E: Display the line break at the end with a $sign

4)-n: Print out line numbers (including blank lines)

5)-T: Display Tab as ^I

6)-v: List some special characters that cannot be seen

2. tac file path: display file from back to front.

3.nl [-bnw] File: Add Line Number Output, Parameters:

1)-b: Specify a nice display, -b a: List line numbers including blank lines;-b t: List line numbers that are not blank lines (default).

2)-n: List the representation method of line number, -n ln: Line number is displayed on the far left of the screen;-n rn: Line number is displayed on the far right of its own field without adding 0;-n rz: Line number is displayed on the far right of its own field with adding 0

3)-w: occupied digits of row number field

These instructions are directly the entire file, displayed on the screen, the following instructions can achieve paging.

4. more File Path: Display files in paginated form. When opening, shortcut keys are:

Space bar: page down

Enter: Down one line

/String: Search down for the specified string

Q: Leave more

b or ctr+b: previous page, invalid for pipeline

5. less File Path: Display files in paginated form. When opening, shortcut keys are:

Spacebar or pagedown: page down

pageup: turn up the page

/String: Search down for the specified string

?String: Search up for the specified string

n: Repeat previous search

N: direction repeat previous search

Q: Leave more

6. head [-n] number file path: lists the first n lines of the file, if n is negative, it means to list the last n lines.

7. tail [-fn] number File path: Take the next few lines, parameters:

-nnumber: Display the last number line, the default display of the last 10 lines, if + line before the number, it means that the number line after the display

-f: Continuously detect the following filename, which needs ctr+c to terminate. (Often used to monitor log files)

8.od [t TYPE] file: read binary file, where TYPE types are, a: use default characters to display, c: use ASCII characters to output, d[size]: use decimal to output data, each integer occupies size bytes;f[size]: use floating point to output data, each number occupies size bytes;o[size]: use octal to output data, each integer occupies size bytes;x[size]: use hexadecimal to output data, each integer occupies size bytes.

9. touch [-acdmt] File: Create an empty file, or modify the file at various times, parameters:

1)-a: Revise atime only

2)-c: only modify the time of the file, if the file does not exist, do not create a new file

date= time = date = time = date= date =

4)-m only modifies mtime

5)-t can be followed by the time to be revised instead of the current time, in the format [YYMMDDhhmm]

If the file does not exist, it means that all time values of the newly created empty file are the current time.

Thank you for reading, the above is the content of "CentOS how to access the file content", after the study of this article, I believe everyone has a deeper understanding of how CentOS access the file content, the specific use of the situation still needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

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

Servers

Wechat

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

12
Report