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