Linux file Management system-file operations

Source: Internet
Author: User

To create a file:

Touch

    • Role

Modifies the file timestamp. If the file does not exist, a new file is created.

Access time: Read the contents of this file once, this time will be updated.

Modification time: The last time the file content was modified.

Change time: The last time the Inode node of the file was modified.

    • Options

-C: Do not create a new file.

--no-create: Do not create a new file.

-a:access, modify the file access time.

-m:modify, modify the file modification time.

-T: Modifies the specified time at the specified time (in the format [[CC]YY]MMDDHHMM[.SS]).

Touch–t 201409132040–m Test

    • Parameters

File name to be modified.

Install

    • Role

Copy the file and set its properties.

    • Options

-D: Create a directory.

Rm:remove

    • Role

Delete the file.

    • Options

-i:interactive, Interactive.

-f:force, force Delete.

-r:recursive, recursive delete.

    • Parameters

The file name to be deleted.

Cp:copy

    • Role

Copy files and directories. Copy one file to another file or copy multiple files to another directory.

    • Options

-R:

-R:

--recursive:

Recursive replication.

-F:

--force:

Forced replication overwrites the source file.

-I: interactive operation.

-A: Archive replication, often used for backups.

-P: Copies files as originally defined (permission information, ownership information, timestamp).

-L: Establish a hard link for the file.

-D: Copy as Symbolic link.

-P:

--no-dereference:

Copy as Soft link.

-L:

--deference

Copy to file.

    • Parameters

The name of the file to be copied.

Mv:move

    • Role

Move or rename the file.

    • Options

-F:

--force:

Forces the file to move.

    • Parameters

The file name to be moved.

Stat:state

    • Role

View information such as file or file system status.

    • Options

-C: Displays file information in the specified format.

--format: Displays file information in the specified format.

    • Parameters

File information to view.

File

    • Role

View the file content type.

    • Parameters

The name of the file to view.

Cat:concatenate

    • Role

Connect and display the file. When the file is connected, the results are all output. It is not recommended to use this command if the content is too long.

    • Options

-N: Displays the line number.

-E: Displays the line terminator $.

-T: Displays tabs.

-V: Displays additional nonprinting characters.

    • Parameters

File name to be merged.

Tac

    • Role

Displays the file information in reverse, starting at the last line.

    • Shortcut keys

Shift+pgup/pgdown: Command line display page.

CTRL + C: Abort command execution, start command input from new.

    • Parameters

The name of the file to view.

More

    • Role

Page view file information, support page backward. Shortcut keys are basically the same as man, and do not support K shortcuts. When you turn to the last page, you exit.

    • Parameters

The name of the file to view.

Less

    • Role

is basically the same as man's usage.

    • Parameters

The name of the file to view.

Head

    • Role

Displays the contents of the front row of the file.

    • Options

-N: The number of rows displayed, which defaults to 10.

    • Parameters

The name of the file to view.

Tail

    • Role

Displays the number of rows following the file.

    • Options

-N: The number of rows displayed, which defaults to 10.

-F: Monitor file contents. Look at the end of the file, do not exit, wait for the new content appended to this file to be displayed later.

    • Parameters

The name of the file to view.

Linux file Management system-file operations

Related Article

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.