File management commands for Linux common commands

Source: Internet
Author: User

Echo:display A line of text, which is added by default.

-E: escape escapes special characters

-N: Do not wrap the last line no LR

cp: File copy, rule: Only the last target, copy a file to a file or multiple files to a directory !

-r: Recursive copy Directory

-I: Interactive display replication

-F: Forced replication, overwriting

-P: Preserve the properties of the source file, timestamp

-P: Save as link when copying linked files (default is the file that the copy link points to)

-D: Keep links when copying

-A: Archive replication, often used for backup

Examples

cp/etc/passwd/tmp/Copy to directory and save the original file name

Cp/etc/passwd/tmp/test See if test is a file or a directory, directory: is responsible for the directory, the file is replaced

Cp-r/etc/init.d//TMP/ABC If ABC does not exist, the ABC directory is created and the INIT.D content is copied to ABC, and if ABC exists and is a directory, the INIT.D is copied to ABC, and if ABC exists and is a file, it cannot be copied.

MV: Moving or renaming files

MV SRC (source) DEST (target)

In the same directory can be renamed with MV: MV ABC BCD or MV-T target source

Examples

Rename in the same directory, there is an ABC file can be the MV ABC BCD to rename the ABC to BCD

File : Used to view the types of normal and system files RM

RM: Deleting files

-I: interactive delete

-F: Violent deletion

-R: recursive delete

commands can be combined with

Touch

Touch: Create a file

-C: The file is not created when it exists

-A: Change the access time of the file only

-M: Change the file's modification time only

-T: Set the timestamp of the file (month and day ). seconds), used in conjunction with aandm

stat: View the status of a file or file system

Cat: Connect and display the information of the file, which is all the information in the display file

-N: The line number can be displayed when displayed, this line number is only displayed, and the contents of the file is not related

-E: Displays the line terminator for each line, so the line terminator for the Linux Chinese text file is $

-T: Tabs can be displayed

-V: Display other nonprinting characters

-A: Show all symbols

File management commands for Linux common commands

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.