![sudo:移动:找不到命令](https://linux22.com/image/149327/sudo%EF%BC%9A%E7%A7%BB%E5%8A%A8%EF%BC%9A%E6%89%BE%E4%B8%8D%E5%88%B0%E5%91%BD%E4%BB%A4.png)
我想在我的新 Linux Mint 19.1 上自动安装 pycharm,并且一切正常,直到我使用 sudo move 命令。每当代码转到该行时,我都会收到“sudo:move:找不到命令”错误。我不知道出了什么问题。我尝试按照这里的教程进行操作:
https://www.danieblog.com/technology/software/how-to-install-pycharm-community-in-linux-mint-72.html
我的代码如下:
#!/usr/bin/python3.6
import platform
import os
import time
pycharm_version = 'pycharm-community-2018.3.5'
filename = pycharm_version + '.tar.gz'
pycharm_link = 'https://download.jetbrains.com/python/' + filename
if platform.system().lower() == 'linux':
command = 'wget {}'.format(pycharm_link)
print(command)
os.system(command)
command = 'tar xvaf {}'.format(filename)
print(command)
time.sleep(1)
os.system(command)
time.sleep(1)
command = 'sudo move /home/user/{} /opt/pycharm'.format(pycharm_version)
print(command)
os.system(command)
答案1
它应该是
sudo mv /home/user/{} /opt/pycharm
正如上面评论中提到的,这可以在 shell 脚本中更简单地实现。