用ls -l查了一下,环境中是有beeline的,但是输入命令就提示找不到。
[root@node01 bin]# beeline
-bash: beeline: 未找到命令
[root@node01 bin]# ls -l
总用量 44
-rwxr-xr-x. 1 root root 881 8月 23 2019 beeline
drwxr-xr-x. 3 root root 4096 7月 5 11:18 ext
-rwxr-xr-x. 1 root root 10158 8月 23 2019 hive
-rwxr-xr-x. 1 root root 1900 8月 23 2019 hive-config.sh
-rwxr-xr-x. 1 root root 885 8月 23 2019 hiveserver2
-rwxr-xr-x. 1 root root 880 8月 23 2019 hplsql
-rwxr-xr-x. 1 root root 3064 8月 23 2019 init-hive-dfs.sh
-rwxr-xr-x. 1 root root 832 8月 23 2019 metatool
-rwxr-xr-x. 1 root root 884 8月 23 2019 schematool
[root@node01 bin]#
原因:没有将这个bin目录放到环境变量 PATH中,所以直接使用 beeline
命令,提示找不到。
此时可以通过绝对路径或相对路径的方式执行beeline
命令。看截图,此时你在bin目录下,可以使用相对路径./beeline
来执行
你可以bin/beeline
当前目录下直接 ./beeline不就行了