【发布时间】:2014-11-10 21:10:47
【问题描述】:
我是 linux 新手,我的桌面上有一个要运行的 shell 脚本 (.sh) 文件。 这些是我所做的步骤:
这是我桌面上test.sh 文件的内容:
#!bin/bash
#test.sh
echo "test"
我想通过终端运行(执行)test.sh。这些是我正在使用的命令:
cd Desktop
我允许通过以下方式运行test.sh:
chmod +x test.sh
然后尝试打开文件:
test.sh
但我收到此错误:
test.sh: command not found
我做错了什么?
【问题讨论】:
-
您的当前目录在默认的 Linux 路径中是 NOT。有充分的理由。试试这个:
./test.sh.