简体   繁体   English

将文件移动到另一个目录中的目录并在一个命令行中重命名它?

[英]Move a file to a directory that is within another directory and rename it in one command line?

So, we have a parent_dir and it contains a child_dir and a file1.所以,我们有一个 parent_dir,它包含一个 child_dir 和一个 file1。 How can I move a file1 to a child_dir and rename it as file2?如何将 file1 移动到 child_dir 并将其重命名为 file2? let's assume my pwd is /var让我们假设我的密码是 /var

You can just move a file from one dest.您可以只从一个目标移动文件。 to another (it changes its name):到另一个(它改变了它的名字):

mv /parent_dir/file1 /parent_dir/child_dir/file2 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Linux中,如何在一行中编辑文件并将文件从一个目录移动到另一目录? - How to edit and move a file from one directory to another in one line in Linux? 将子文件夹从一个目录移动到另一目录 - move sub folder in one directory to another directory 将多个文件从一个目录移动到远程 sftp 服务器上的另一个目录 - Move multiple file from one directory to another on remote sftp server Linux根据目录中的另一个文件重命名文件? - Linux rename files based on another file in the directory? Linux:通过文件夹目录的一部分重命名文件并移动文件 - Linux : Rename file by a part the folder directory and move file 如何控制所有文件扩展名或不控制另一个目录? 仅在一行中 - How to control all file extensions or not another directory? in just one line 使用 Paramiko 将文件从一个目录移动到另一个目录 - Move files from one directory to another with Paramiko 如何在不使用脚本的情况下将文件移动到另一个目录,仅使用命令行? - How can I move files to another directory without using a script, just the command line? Linux命令移动目录 - Linux command to move a directory 如何在与命令行中的另一个模式匹配的目录中“查找”匹配模式的文件? - How can I `find` files matching pattern within a directory matching another pattern from the command line?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM