service命令是要用ROOT用户来执行的,
而出错的用户是用su root切换到ROOT用户下,这个命令没有也不会把环境带过去!

用如下命令就不会出错了:
su - root

注意:su 后面是一个空格,横线后面也是一个空格,千万不能省略.
很简单,但是很实用!

备注:随笔中内容来源于网上资料整理,仅供参考。

bash: service: command not found 错误的解决方法的更多相关文章

  1. 一秒解决CentOS下service 功能 不能使用 bash: service: command not found

    首先检查自己是否 使用的是root用户 如果是并且还不能用-----执行以下操作 在centos系统中,如果/sbin目录下没有service这个命令,就会出现 bash: service: comm ...

  2. 解决CentOS下service 功能 不能使用 bash: service: command not found

    首先检查自己是否 使用的是root用户 在centos系统中,如果/sbin目录下没有service这个命令,就会出现 bash: service: command not found 解决步骤如下: ...

  3. linux下报错bash: service: command not found

    在linux下操作的时候经常会遇到,bash: service: command not found这个错误,以前在网上找了,照着弄了,也没细看原因,今天又碰到这个问题,就顺便研究一下. 1.通常这种 ...

  4. centos没有service命令的恢复方法(-bash: service: command not found)

    转载自:https://blog.csdn.net/u014175572/article/details/53375049?utm_source=itdadao&utm_medium=refe ...

  5. 【转】mac终端安装node时候,显示“-bash: brew: command not found”,怎么解决?

    原文网址:https://segmentfault.com/q/1010000004221389/a-1020000004221408 mac终端安装node时候,显示“-bash: brew: co ...

  6. 安装tomcat出现failed to install tomcat8 service错误及解决方法

    failed to install tomcat8 service 如下图所示:     一.安装tomcat出现failed to install tomcat6 service错误及解决方法(转载 ...

  7. 安装tomcat出现failed to install tomcat6 service错误及解决方法(转载)

    安装安装版tomcat会出现failed to install tomcat6 service ,check your setting and permissio的概率是非常低的,但是最近楼主就老出现 ...

  8. CentOS 安装hping3工具及安装遇到的错误及解决方法

    hping是用于生成和解析TCPIP协议数据包的开源工具.创作者是Salvatore Sanfilippo.目前最新版是hping3,支持使用tcl脚本自动化地调用其API.hping是安全审计.防火 ...

  9. Linux系统Vsftp 传文件出现 553 Could Not Create File错误的解决方法

    解决方法: 登录出现了这个错误提示:553 Could not create file SELinux设置如下 查看SELinux设置 [root@localhost ~]# getsebool -a ...

随机推荐

  1. 【Java】maven打包源码、依赖插件

    <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactI ...

  2. jumpserver安装和使用

    jumpserver安装 #centos6 centos7都可用yum -y install git python-pip mysql-devel gcc automake autoconf pyth ...

  3. C语言基本数据类型大小

    C语言基本数据类型占用的字节数可以通过如下例子获取: #include<stdio.h> int main(void) { printf("char size=%d \n&quo ...

  4. python,mock-server之moco

    python,mock-server之moco1.mock使用:mock除了用在单元测试过程中,还有一个用途,当前端开发在开发页面的时候,需要服务端提供API接口,此时服务端没开发完成,或者说没搭建测 ...

  5. [题解]Shorten IPv6 Address-模拟(2019牛客多校第六场B题)

    题目链接:https://ac.nowcoder.com/acm/contest/886/B 题意: 您将获得一个IPv6地址,该地址是128位二进制字符串.请根据以下规则确定其最短的表示: 以十六进 ...

  6. Gentoo 搭遗

    安装 app-portage/gentoolkit 使用如下方式,可查询某个被包安装的文件列表,可以筛选文件类型 equey files [--filter=doc] <包名称> emer ...

  7. js中的经典案例--简易万年历

    js中的经典案例--简易万年历 html代码 <!DOCTYPE html> <html> <head> <meta charset="utf-8& ...

  8. (转)微信调用扫码和支付功能是都报错 the permission value is offline verifying

    原文地址:https://blog.csdn.net/qq_34794885/article/details/98504970

  9. void*和void类型

    |   版权声明:本文为博主原创文章,未经博主允许不得转载. void的类型是无类型的数据,void*表示无类型的指针.其中void*可以指向任何数据类型的指针. void类型的用法: (1).voi ...

  10. 阮一峰 ES6

    阮一峰 ES6:http://es6.ruanyifeng.com/#docs/module