[英]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.