从另一个目录移动命令
我需要从另一个目录移动文件。
假设你在这个目录中: /home/CurDic1
我的文件位于这个目录中: /usr/CurDic2
我需要写一些像这样的东西(我刚刚做了它向上):
/usr/CurDic2:>cd /home/CurDic1 | mv file1.txt /home/CurDic1/SubDic1
I need to move a file from another directory.
Suppose you are in this directory: /home/CurDic1
And my file is located in this directory: /usr/CurDic2
I need to write someting like this (I just made it up):
/usr/CurDic2:>cd /home/CurDic1 | mv file1.txt /home/CurDic1/SubDic1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以向移动命令添加完整路径。在您的特定情况下,它将是:
重要的是要知道
.
是当前目录。如果您想移动到
/home/CurDic1/SubDic1
,您可以这样做:关于您编造的示例,
|
被称为“管道”,它用于将左侧命令的输出重定向到右侧列的输入。例如cat file.txt | less 同时将 file.txt 的内容重定向到 less 命令,该命令用于滚动长文本数据。但是您可以这样做
;
是命令分隔符,这意味着将执行第一个命令,然后执行下一个命令。您可以像这样链接许多命令:cmd1; cmd2; cmd3;等等
You can add a full path to your move command. In your particular case, it will be :
It is important to know that
.
is the current directory.If you want to move to
/home/CurDic1/SubDic1
, you can do :Concerning your made up example,
|
is known as a "pipe" and it is used to redirect the output from the left command to the input of the right column. For examplecat file.txt | less
while redirect the content of file.txt to the less command which is used to scroll in long textual datas.However you can do
the
;
is a command separator, it means that the first command will be executed and then the next one. You can chain many commands like this :cmd1; cmd2; cmd3; etc