简体   繁体   English

第一次使用处理器。 如何将文件移动到其他目录

[英]Using treaters for the first time. How move file to other Directory

I have created two directories [Dir1] and [Dir2] and inside [Dir1], I have created a file called impFile.我创建了两个目录 [Dir1] 和 [Dir2],在 [Dir1] 中,我创建了一个名为 impFile 的文件。

Now, From where I ended up, I want to move impFile that is in Dir1 into Dir2.现在,从我结束的地方开始,我想将 Dir1 中的 impFile 移动到 Dir2 中。 I tried this我试过这个

" mv /Dir1/impFile.txt /Dir2/impFile.txt " mv /Dir1/impFile.txt /Dir2/impFile.txt

but it doesnt work.但它不起作用。

Can anybody tell me what I can do to make this work.谁能告诉我我能做些什么来完成这项工作。


[ec2-user@ip-178-31-8-98 ~]$ mkdir Dir1
[ec2-user@ip-178-31-8-98 ~]$ mkdir Dir2
[ec2-user@ip-178-31-8-98 ~]$ cd /home/ec2-user/Dir1

[ec2-user@ip-178-31-8-98 Dir1]$ echo hi > impFile.txt

[ec2-user@ip-178-31-8-98 Dir1]$ cd
[ec2-user@ip-178-31-8-98 ~]$
[ec2-user@ip-178-31-8-98 ~]$ pwd
/home/ec2-user

[ec2-user@ip-172-31-8-94 ~]$  <-- WHERE I ENDED UP

If I'm not wrong,如果我没记错的话

"/" = root of the system. “/” = 系统的根目录。 Instead, you wish to call move from your current folder, so the mv command should look like:相反,您希望从当前文件夹调用 move,因此 mv 命令应如下所示:

mv ./Dir1/impFile.txt ./Dir2/

"." “。” means "actual position"意思是“实际位置”

it is the same as doing:这和做的一样:

mv /home/ec2-user/Dir1/impFile.txt /home/ec2-user/Dir2/

Quick edit: mv = target (file) to destination (folder)快速编辑:mv = 目标(文件)到目标(文件夹)

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

相关问题 如何使用inotifywait监视带有时间和文件的目录? - How to monitor a directory with time and file using inotifywait? Linux:如何将已安装的目录移动到其他地方? - Linux: how to move the installed directory to other place? 如何使用Linux(Bash)在目录中移动文件 - How to move file inside directory, using Linux (Bash) 使用 Bash 将文件移动到具有给定条件的目录 - Move file to a directory with a given condition using Bash 需要使用 unix 脚本将文件名移动到带有文件路径的目录中 - Need to move file names in a directory with path to a file using unix script 如何将主目录列表附加到文本文件以及如何移动文件? - How to append list of home directory to a text file and how to move files? 如何根据文件扩展名进行 FOR 循环以将文件移动到目录 - How to make a FOR loop to move files to directory based on file extension Ncurses 和 gdb 屏幕在调试时重叠。 所以我想把两个屏幕分开 - Ncurses and gdb screens overlap at debug time. So I want to split the two screens with each other 如何使用 Linux Ubuntu 终端将图像移动到不同的目录 - How to move images to a different directory using Linux Ubuntu terminal 一次将一个文件移动到另一个目录,提取文件名的一部分,并在所有文件移动后停止 - Move one file at a time to another directory, extract part of filename and stop after all files moved
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM