Linux View the contents of the file, create, view the soft hard link command example

Source: Internet
Author: User

Command 1: View file contents

"Cat filename" to view the contents of the file, the page stays at the end.

"More file name" Paging View file contents

Enter the next line

Space page

Q exit

"Head filename" to view the first few lines of the contents of the file, the default first 10 lines, if you want to make a look at the top N rows, add option-N

For example "head-5" view the first five elements

Tail and head opposite, "Tail-5" the last five elements.

TAIL-F displays the last ten lines dynamically, such as viewing log files

Command 2: Create a soft connection

"Ln-s XXX Path 1" Creates a soft connection for XXX in Path 1

Characteristics:

1. File Type L

2. The equivalent of Windows shortcuts

Command 3: Create a hard link

"Ln xxx path 1" Creates a soft connection for XXX in Path 1

Characteristics:

1. File Type-

2. Meet in the copy, but can be synchronized update.

Note 1: The Hard link I node is the same, the soft connection I node is different, the view I node command is: Ls-i.

Note 2: Creating hard Links cannot cross partitions (file system), soft links can be.

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.