Linux 移动文件到指定目录
时间: 2023-09-07 22:17:47 浏览: 107
使用命令mv可以将文件移动到指定目录。例如,将文件file.txt移动到目录/home/user/下,可以使用以下命令:
```
mv file.txt /home/user/
```
如果目录不存在,则文件将被重命名为/home/user/file.txt。如果需要将文件夹及其内容移动到目录下,则需要使用递归选项-r:
```
mv -r folder /home/user/
```
阅读全文
相关推荐
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![doc](https://img-home.csdnimg.cn/images/20241231044833.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![txt](https://img-home.csdnimg.cn/images/20241231045021.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![](https://img-home.csdnimg.cn/images/20250102104920.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![docx](https://img-home.csdnimg.cn/images/20241231044901.png)
![txt](https://img-home.csdnimg.cn/images/20241231045021.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![md](https://img-home.csdnimg.cn/images/20250102104920.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)