一、cp命令

Linux中的复制命令。

复制文件:

wang@wang:~/workpalce/python$ tree
.
├── .txt
├── dir
└── module directories, file
wang@wang:~/workpalce/python$ cp .txt module/
wang@wang:~/workpalce/python$ tree
.
├── .txt
├── dir
└── module
└── .txt directories, files

复制目录:

wang@wang:~/workpalce/python$ tree
.
├── .txt
├── dir
└── module
└── .txt directories, files
wang@wang:~/workpalce/python$ cp module/ dir/ -r
wang@wang:~/workpalce/python$ tree
.
├── .txt
├── dir
│   └── module
│   └── .txt
└── module
└── .txt directories, files

二、mv命令

mv命令可以作为Linux中的剪切命令,也可以给文件或者文件夹重命名。

剪切文件:

wang@wang:~/workpalce/python$ tree
.
├── .txt
├── dir
└── module directories, file
wang@wang:~/workpalce/python$ mv .txt module/
wang@wang:~/workpalce/python$ tree
.
├── dir
└── module
└── .txt directories, file

剪切文件夹:

wang@wang:~/workpalce/python$ tree
.
├── dir
└── module
└── .txt directories, file
wang@wang:~/workpalce/python$ mv module/ dir/
wang@wang:~/workpalce/python$ tree
.
└── dir
└── module
└── .txt directories, file

文件重命名:

wang@wang:~/workpalce/python$ tree
.
├── .txt
└── module directory, file
wang@wang:~/workpalce/python$ mv .txt .txt
wang@wang:~/workpalce/python$ tree
.
├── .txt
└── module directory, file

文件夹重命名:

wang@wang:~/workpalce/python$ tree
.
├── .txt
└── module directory, file
wang@wang:~/workpalce/python$ mv module/ dir
wang@wang:~/workpalce/python$ tree
.
├── .txt
└── dir directory, file

三、注意

cp文件夹时需要-r参数,mv文件夹时不需要-r参数。

最新文章

  1. Vue#组件
  2. 项目里的jquery.min.js错误
  3. HTML5 自制本地网页视频播放器
  4. python的几个常用内置函数
  5. Myeclipse10中出现Cannot return from outside a function or method错误提示
  6. 关于 ServiceStack.Redis 4.0 License
  7. HW4.22
  8. C#如何实现url短地址?C#短网址压缩算法与短网址原理入门
  9. Android实训案例(二)——Android下的CMD命令之关机重启以及重启recovery
  10. 深入探究Lua的GC算法(上)-《Lua设计与实现》
  11. POJ 1201 Intervals (经典) (差分约束)
  12. jmeter(二十二)内存溢出原因及解决方法
  13. pagehelper 使用
  14. I/O系统(一)
  15. SSM项目layui分页实例
  16. JDK5的新特性之 增强for
  17. 判断PC机大小端
  18. SHT20 IIC总线驱动概述
  19. Lottie开源库实现Android动画效果
  20. 监听器(web基础学习笔记二十二)

热门文章

  1. Segments--poj3304(判断直线与线段之间的关系)
  2. 洛谷—— P1133 教主的花园
  3. 2017icpc乌鲁木齐网络赛Colored Graph (构造)
  4. Spring Data JPA 进阶
  5. SQL2008安装时,“provider: 命名管道提供程序, error: 40 - 无法打开到 SQL Server 的连接) (.Net SqlClient Data Provider)” 错误的解决方案
  6. [LeetCode] Contains Duplicate(II,III)
  7. 在开发过程中,如何在手机上测试vue-cli构建的项目
  8. 【Mongodb教程 第十一课 】MongoDB 聚合
  9. Android5.0(lollipop)新特性介绍(一)
  10. Java中有多少种设计模式?请简单画一下三种常见设计模式的类图?