Linux file Content Lookup instructions

Source: Internet
Author: User

    1. Cat [-ABENTV] file path: Displays the specified file in read-only format, parameters:

1)-A: Equals -vet, can list some special characters instead of blank

2)-B: List line numbers, list only lines with non-empty hundred lines

3)-E: Displays the end of the break in $

4)-N: Print travel number (including blank lines)

5)-T: The Tab key is displayed in ^i

6)-V: List Some special characters that can't be seen

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

3.nl [-BNW] Archive: Add line number output, parameters:

1)-B: Specify a good display,-b a: Lists the line numbers including blank lines;-b t: Lists the line numbers for non-empty rows (default).

2)-n: Lists the line number representation,-n-Ln: The line number is displayed at the left of the screen, and the-n RN: Theline number is displayed at the very right of the field and does not add 0; - N RZ : The line number is displayed to the right of the field, plus 0

3)-W: the number of digits in the line number field

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

4.more file path: Displays the file as a paging, and when opened, the shortcut keys are:

Space bar: Page DOWN

Enter: Line down

/ String: Searches down the specified string

Q: Leave more

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

5.less file path: Displays the file as a paging, and when opened, the shortcut keys are:

SPACEBAR or pagedown: Page DOWN

PageUp: Page Up

/ String: Searches down the specified string

? String: Searches up the specified string

N: Repeat the previous search

N: The direction repeats the previous search

Q: Leave more

6.head [-n] Number file path: Lists the first n rows of the file , and if n is a negative number, indicates where the line is listed to the reciprocal n rows.

7.tail [-FN] number file path: Take the following lines, parameters:

-nnumber: Displays the last number line, which displays the last line by default , and if the number is added in front of number, the number is displayed. What's next?

-F: Continuous detection of the following file name, need to ctr+c termination. (commonly used to listen to log files)

8.od [T type] archive: reads binary, where type has,a: is displayed with default characters,C: Uses 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]: uses hexadecimal to output data, each integer occupies size bytes.

9.touch [-ACDMT] Archives: Create an empty file, or modify the file for various times, parameters:

1)-a: revision only Atime

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

3)-D: You can follow the date you want to revise instead of the current date, or you can use the-date= " date or Time ", you can use the "2 days ago" statement

4)-M only modifies mtime

5)-T can be followed to revise the time instead of the current time, the format is [YYMMDDHHMM]

If the file does not exist, the new empty file will be the current time value for each time.


This article is from "Tiger Brother's Blog" blog, please be sure to keep this source http://7613577.blog.51cto.com/7603577/1589931

Linux file Content Lookup instructions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.