linux常用命令-3

一:mkdir 创建目录

    1:mkdir /a  在根目录下创建a目录

    2:mkdir /a /b /c  在根目录下创建a,b,c目录

    3:mkdir -p  /test/a/b   加了参数P,如果根目录下没有test目录,也会创建成功

二: echo 显示一行文本

    1:echo hello 在命令行输出 hello

    2:echo hello > a.txt  在a.txt文件中写入hello(注意是清除所有内容然后写入,要是a.txt文件不存在则主动创建)

         cat a.txt

         hello

     3: echo hello form a.txt >> a.txt 在a.txt 文件中追加内容

          cat a.txt 

扫描二维码关注公众号,回复: 6932309 查看本文章

          hello

          hello form a.txt

三: ifconfig 显示或设置网络设备 

四: ping ip/域名 

      1:ping 127.0.0.1  检查自己主机是否联网

猜你喜欢

转载自www.cnblogs.com/Be-your-own-hero/p/11290217.html