【问题标题】:cannot run "mv some_file.txt ~/myproject/ " command in the cmd ipython无法在 cmd ipython 中运行“mv some_file.txt ~/myproject/”命令
【发布时间】:2021-08-22 18:08:15
【问题描述】:

我已经在 Windows 10 中安装了 Anaconda,我可以在 cmd 中使用一些 Linux 命令(如“ls”和“pwd”)运行 IPython,但是当我尝试运行“mv”命令时 "

mv some_file.txt ~/myproject/

它给出了错误:

File "<ipython-input-28-304da5ec8c93>", line 1.

谁能告诉我运行这个shell代码的正确格式是什么 命令提示符 IPython。

【问题讨论】:

    标签: shell ipython


    【解决方案1】:

    to_run: mv ../myproject.txt ./

    在 [45] 中:!move myproject.txt C:\Users\user_name

       1 file(s) moved.
    

    在 [46] 中:密码

    输出[46]:'C:\Users\user_name\folder_name'

    在 [48] 中:cd ..

    C:\Users\use_name

    ********* to_run: cp myproject.txt myproject\

    在 [49] 中:!copy myproject.txt C:\Users\user_name\myproject

       1 file(s) copied.
    

    感谢@Ahmed Yehia 你带我找到答案

    【讨论】:

      【解决方案2】:

      您收到错误消息,因为mv 在 Windows 上不是受支持的魔术命令。浏览文档我找不到等效的魔法命令,但这可能会对您有所帮助:

      !move some_file.txt C:\Users\Some_User\myproject\

      【讨论】:

      • 嗨艾哈迈德,谢谢你的回复,我在命令提示符下试过了,但我仍然收到如下错误:In [22]: !ls batman.py testcats.py In [23]: !pwd /c/Users/tanma/myproject In [24]: !move test_file_2.txt C:\Users\tanma\myproject\ @987654328 @In [25]: !move test_file_2.txt /c/Users/tanma/myproject The system cannot find the file specified. In [26]:
      猜你喜欢
      • 1970-01-01
      • 2018-10-26
      • 1970-01-01
      • 1970-01-01
      • 2020-04-16
      • 1970-01-01
      • 2014-09-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多