[Continuous UPDATE] Important commands for Linux basics

Source: Internet
Author: User

Summary of commands: 100 or so

Mkdir

方法一 [[email protected] ~]# mkdir /test && ls -ld /test方法二 [[email protected] ~]# cd / && mkdir date && ls -ld /test

Ls-l (long) d (directory) displays directories or files

&&Instead, the difference is that the first command executes the ; ; next command, regardless of whether the first command has an error. && is to execute the next command only after the first command has been executed correctly.

Touch

方法一(直接方法)[[email protected] ~]# touch /data/test.txt或[[email protected] ~]# cd /data; touch test.txt方法二(间接方法)[[email protected] ~]# echo > /data/test.txt或[[email protected] ~]# > /data/test.txt

Echo

> 标准输出重定向,输出到第一行,会覆盖原来的文件[[email protected] ~]# echo "I am studying Linux" > o.txt>> 标准追加重定向,追加到已有文字的下一行,不会覆盖原有内容[[email protected] ~]# echo "I am studying Linux" >> o.txt

Cat-----View File contents

把123(123标签的标准写法是EOF)之间的内容输出到test.txt中去[[email protected] ~]# cat >>test.txt<< 123> ddd> dfff> fsdf> 123[[email protected] ~]# cat test.txtddddffffsdf

CP-APR-----Copy files or directories

RmDir Directory Name-----Delete empty Directory Chicken command

Head Header Show file head----row number default header 10 rows
Tail tail display file trailing-n line number default end 10 line

grep excludes-V "Paichu" direct filter "Guolv"
Sed-n/guolv/test.txt
awk/guolv/test.t

Alias

别名的的作用:1)通过给危险命令加一些保护参数,防止人为误操作2)把很多复杂的字符串变成一个简单的字符串[[email protected] ~]# alias hello=‘echo "How are u?"‘[[email protected] ~]# helloHow are u?对应的unalias是取消别名

Find/-type f-name "Test.txt"

diff a.txt b.txt-----compare file Content Differences

Vimdiff a.txt B.txt

[Continuous UPDATE] Important commands for Linux basics

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.