Operations engineers must have 150 commands (serial ... )

Source: Internet
Author: User
Tags directory create

OPS engineers must have 150 commands

1.mkdir make directory Create directory, example: Mkdir/data means to create a data directory under the root.

2.CD Change directorys switch directory, example: CD/ presentation into the root directory.

3.ls list directory, example: Ls/etc,-l (long) long format displays the directory or file attributes.

-d (directory), which means viewing the directory

4.Touch Create file or change file timestamp, example: Touch/data

5.pwd Print work Dirtorys printing working directory (path), example: pwd

6.vi Notepad (simple, less functional)

7.Vim Editor (complex, more functions)

8.Cat View the contents of the file (edit, append). Example: Cat Oldboy.txt

Example:

Cat >>/data/oldboy1.txt<<eof

I am studying Linux.

Eof


9.Echo is a printout of the contents of something, example: Echo ' I am study Linux. '

Example:

Echo '

1111

2222

3333

' >>oldboy.txt


Example:

Echo-e ' I am study linux\ni am study Linux ' >>b.txt


Relative path and absolute path

Windows absolute path: E:\2016-old boy-common OPS tool, the path from the beginning.

Linux absolute path: Cat/etc/sysconfig/network-scripts/ifcfg-eth0 The path from the/start.


relative path: The cat Etc/sysconfig/network-scripts/ifcfg-eth0 does not start from/to the path without starting from scratch.


Special symbols:

> or 1> output redirection, the front of the input into the following file, will erase the original contents of the file.

>> or 1>> Chase aggravating the direction, the front of the things entered into the tail of the file, will not erase the original contents of the file.

< or 0< input redirection, example: Xargs-n 2 <b.txt

<< or 0<< append input redirection,

2> Error redirection,

2>> Error Append redirect,


Description

1. The direction of the cutting head is the flow of data.

2. Number Description:

A. Standard input (stdin): code 0, using < or << data flow from right to left

B. Normal output (STDOUT): Code 1, using > or >>, Data flow from left to right. echo oldboy >a.txt 2>&1 = echo Oldboy >a.txt 2>&1

C. Error output (stderr): Code 2, using 2> or 2>>, data flow from left to right. cho Oldboy 2>a.txt 1>b.txt


This article from "Good Cook" blog, reprint please contact the author!

Operations engineers must have 150 commands (serial ... )

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.