Linux Common Operation Command Rollup

Source: Internet
Author: User
Tags diff echo command echo message save file

Linux Common Operation Command Rollup

1.ls command

LS to display the current directory file list server Tutorial by default

Ls-a Show all files including hidden files

LS-L displays file attributes, including size, date, symbolic connection, read-write and executable

2.CD command

cd dir switches to dir directory in current directory

Cd.. Switch to the previous level of the directory

CD ~ Switch to user directory, such as root, then switch to/root

3.RM command

RM file Deletes a file

Rm-rf dir deletes the entire directory called Dir under the current directory

4.CP command

CP Source to copy file source to target

Cp-av source_dir target_dir Copy Entire directory, two directories exactly the same

CP-FR Source_dir target_dir copies the entire directory and is copied as unlinked, with two directories different when the source directory has symbolic links

5.MV command

MV Source target to rename the file or directory source to target

6.diff command

Diff-run Dir1 dir2 > comparison directory 1 and files in directory 2

Generate Patch files

Diff-run Dir1 Dir2 >dir.diff

Enter Directory 1 dozen Patches

Patch-p1 < ... /dir.diff

7.echo command

Echo message displays a string of characters

8.cat command

Cat file Displays the contents of the file, the same as the DOS type

Cat File | More display the contents of the file and transfer to more program implementation distribution display, using command less file to achieve the same functionality

More distribution commands, generally through the pipeline to the content to it, such as LS | More

9.DU command

Du calculates the capacity of the current directory

Du-sm/root calculates the capacity of the/root directory and takes m as the unit

10.find command

Find-name file is found in the/path directory to see if there are files

11.grep command

Grep-r "chars"./lookup string for all files in current directory Chars-r representation recursive lookup subdirectory

CTRL + C exit recursion

Use of 12.VI

VI File Edit files

VI Original BASIC use and command:

VI is divided into editing status and command status. To enter a command, press ESC to exit the edit state, and then enter the command.

Common commands are:

: X (Exit)

: x! (Quit without saving)

: W (save file)

: w! (write files without asking for information)

: R file (read files file)

:%s/oldchars/newchars/g (Replace all string oldchars with Newchars)

I enter the edit insert state

ESC Exit Edit Status

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.