Linux File and directory management (file lookup)

Source: Internet
Author: User

1.cat (concatenate continuous)

Cat [-abentv] files to view

Compare violence,,, will show it all

Parameter explanation:
-A: equivalent to the effect of-vet parameters (that is, the various invisible symbols of the file are displayed.) );

-B: Lists line numbers but does not display line numbers;

-E: Displays the trailing break character ($ or ^m$) (enter key);

-N: Make a travel number, even the blank line will also be displayed;

-T: the [TAP] symbol in the file is displayed in ^t form, not as a space;

-V lists some special characters that are not visible;

2.tac (cat upside down, prints the contents of the file backwards from the last line)

The TAC is cat backwards writing, then the meaning is clear hahaha haha.

3.nl (add line number to print)

NL [-BNW] File

NL has more specifications for line numbers than Cat-n:

-B: Determines whether blank lines are numbered:-B A indicates blank lines (similar to cat-n), and-B does not display blank lines (default);

-N: Line number position

-N LN: The line number is displayed on the left;

-N RN: The line number is displayed on the right, without adding 0;

-N RZ: line number on the right display, plus 0;

Effect:

-W digits: number of digits occupied by line number

1.more (one page, one page look)

When you look at a file with more love, you can execute several commands:

Space (SPACEBAR): Turn down one page;

Enter key: roll down one line;

/Muziki: Down query "wooden sub-pavilion June" This keyword, repeat query press N. (after entering the slash, the cursor will go to the next line waiting for you to enter, the man command has similar operations);

: F: Displays the file name and the current number of lines;

Q: Press to exit;

b or [ctrl]+b: page forward, only useful for files, not for pipes//I don't know what a pipe is.

2.less (also a page-by-page flip)

Compared with more, the more flexible (bird brother used this word), is more comfortable bar, more forward to the need for a B command, and less can use the keyboard up and down button!

The operation of less and man is very similar, because the Man command is realized by less;

What you can do when the less is run:

Space: Turn down one page;

[PageDown]: Turn down one page from

[PageUp]: Turn up one page

/query: Query "Query" down

? Query: Query Query up

N: Repeat the previous query

N: Reverse Repeating previous query

Q: Leave;

1.head (remove the first few lines)

Head [-N number] File

Parameter interpretation

-N: followed by numbers, number is a few lines display, default display 10 rows

!!! The point is coming!!! What if number is a negative number? For example, 100 rows of files, head-n -10 file will show what?

The answer is that the first 100-10 rows are displayed, and the next 10 lines are not displayed.

2.tail (remove the following lines)

tail [-N number] File

Parameter explanation:

-N: followed by numbers, number is a few lines display, default display 10 rows

-F: Continuous detection of the file, with new content immediately displayed when added;

The number of the head is the same as negative numbers, and if tail numbers is the plus + sign, all the rows after the # are displayed.

Example of a combined command: Display 11 to 20 rows: Head-n File | Tail-n 10, this is the pipeline command.

1.od (read command for non-plain text files)

od [-t file type] File

The "file type" is the specified read mode:

A: The default character output

C: Output with Assic code

D[size]: Output in decimal (decimal), bytes per size is an integer

F[size]: Output in floating-point numbers (Floatl), bytes per size is a floating-point number

O[size]: Output in eight binary (octal), each size bytes is an integer

D[size]: Output in 16 binary (hexadecimal), each size bytes is an integer

Another: Output the file as a comparison of stored values and ASCII in octal: od-t oCc file

Linux File and directory management (file lookup)

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.