L-1-2 Linux Basic command detailed file editing commands

Source: Internet
Author: User

[CP]

CP <source.path\filename> <target.path> copy files to target directory

-R <dir1> <dir2> copy subdirectories


[MV]

MV <source.path\filename> <target.path> Move the file, move to the original file, rename it, or enter a new file name at path.


[Nano]

Nano [<filename>] A simple text editor that creates a new file if the file name is not written.

^x for Exit


[Tee]

Tee <filename> Output The result screen and write to the file


[Touch]

Touch <filename> Modify the timestamp of the file and create it when the file does not exist.


[VI]

VI Editor Command *******************

VI <filename> Create/edit filename File

Press I to enter insert mode to edit the file.

Press ESC to exit insert mode.

: W Save

: Q exit

: Wq Save and exit

: q! Force exit (do not save)

: Set Nu Adds an asterisk to each line of the file

: Set Nonu Cancel line number

:<num> Enter a number and then press ESC, the cursor moves directly to the row header

:/<string> search for a keyword, press ' n ' to find the next

:?<string> search for a keyword, press ' n ' to find the previous


Vim <filename> Color-coded editing

**************************************************


L-1-2 Linux Basic command detailed file editing 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.