Linux 常用命令六 cp和mv
2024-09-03 02:10:43
一、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参数。
最新文章
- Vue#组件
- 项目里的jquery.min.js错误
- HTML5 自制本地网页视频播放器
- python的几个常用内置函数
- Myeclipse10中出现Cannot return from outside a function or method错误提示
- 关于 ServiceStack.Redis 4.0 License
- HW4.22
- C#如何实现url短地址?C#短网址压缩算法与短网址原理入门
- Android实训案例(二)——Android下的CMD命令之关机重启以及重启recovery
- 深入探究Lua的GC算法(上)-《Lua设计与实现》
- POJ 1201 Intervals (经典) (差分约束)
- jmeter(二十二)内存溢出原因及解决方法
- pagehelper 使用
- I/O系统(一)
- SSM项目layui分页实例
- JDK5的新特性之 增强for
- 判断PC机大小端
- SHT20 IIC总线驱动概述
- Lottie开源库实现Android动画效果
- 监听器(web基础学习笔记二十二)
热门文章
- Segments--poj3304(判断直线与线段之间的关系)
- 洛谷—— P1133 教主的花园
- 2017icpc乌鲁木齐网络赛Colored Graph (构造)
- Spring Data JPA 进阶
- SQL2008安装时,“provider: 命名管道提供程序, error: 40 - 无法打开到 SQL Server 的连接) (.Net SqlClient Data Provider)” 错误的解决方案
- [LeetCode] Contains Duplicate(II,III)
- 在开发过程中,如何在手机上测试vue-cli构建的项目
- 【Mongodb教程 第十一课 】MongoDB 聚合
- Android5.0(lollipop)新特性介绍(一)
- Java中有多少种设计模式?请简单画一下三种常见设计模式的类图?