【Linux笔记(002) 】-- centos7 文档操作基本命令,002centos7


一、cd -- ChangeDirectory

  a) 切换到 /DemoLM/ 文件夹

  b) 回到用户 Home 根目录:是哪个账户登录的就会进入哪个用户的根目录

二、pwd -- PrintWorkingDirectory

  a) 查看当前工作目录

三、mkdir -- MakeDirectory

  a) 创建一个 /test/ 目录

四、touch -- 

  a) 创建一个 test.txt 文件

五、rm -- ReMove

  a) 删除 test.txt 文件

  b) 删除 test 文件夹

  c) 同时删除 /test2/ 文件与文件夹

六、cp -- Copy

  a) 将 /test1/ 文件夹下 test1.txt 复制到 /test2/ 文件夹中

  b) 将 /test1/ 文件夹及其中的文件复制到 /test2/ 文件夹中

  c) 还可以使用通配符执行高级操作

    *:表示所有文件与文件夹

    ?:表示一个字符

七、mv -- Move

  a) 移动 /test2/test1/ 文件夹到 /DemoLM/ 中

八、find -- 

  a) 查找 test1.txt 文件

  b) 查找以 test 开头的文件

  c) 查找当前目录下拥有者为 root 的文件

九、cat -- Concatenate

  a) 查看 /etc/services

  b) 与 cat 类似的 head / tail 

    查看前十行

     查看后十行

  c) 与 cat 类似的 more ,一屏一屏显示 /etc/services 

  d) cat 命令可重定向输出内容到文本,将 /etc/services 内容输出到 /DemoLM/test.txt 

 

 

                                         蒙

                                    2017-09-30 13:39 周五

 

相关内容