Linux Command Summary

Source: Internet
Author: User

Linux commands 150 commonly used is also 80.


Linux command operation syntax format diagram:

Command _ parameter _ path file

Rm-f/tmp/t.log

Tips:

A. Parameters of the command are optional

B. Different command paths and files are optional


Simple Help for Command--help command

Help for man = = Command

Help for command (bash built-in commands)

LS ==list view directory list

mkdir ==make Directory role is to create a directory, for example: Mkdir/data

CD ==change directory role is to switch paths, for example: CD/

Touch = = Touch to create a file, for example: Touch oldboy.txt

VI = = Editor, equivalent to a notebook, has the editing function, but weak.

Vim = = Complex Editor, equivalent to, emeditor,editplus,notepad+

echo = = Print out content, with "> or >>" to overwrite and append content to the file

echo "Oldboy oldgirl" >oldboy.txt

Cat = = View File contents

Special usage: Add multiple lines of content

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

I am studing Linux.

Eof

EOF is to appear in pairs, and EOF can be replaced by arbitrary pairs of content.

CP ==copy Copy Command CTRL + C, e.g. CP oldboy.txt/tmp/

-R: Recursive for copying directories;-P: Hold Properties

-A: equivalent to-PDR

MV = = Move directory or file, for example: mv/data/root/

PWD ==print Work Directory View the path of the current user



Shortcut keys:

TAB = = Command, path completion


Special character Commands:

> or 1> redirects will erase all previous data in the file and add new data.

>> or 1>>, the end of the file to add content, will not delete the existing file content.

< input redirection

<< Chase input Redirection

2> Error Redirection

2>> Error Append redirect


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

2. Normal output (STDOUT): Code 1, use > or >> Data flow from left to right.

3. Error output (stderr): Code 2, use 2> or 2>>.

The direction of the arrows is the flow of data


Linux Command Summary

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.