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. [HDU4969]Just a Joke

    题目:Just a Joke 传送门:http://acm.hdu.edu.cn/showproblem.php?pid=4969 分析: 呀,根本不会做,5555~(逃 http://blog.cs ...

  2. iOS 获取全局唯一标示符

    这个方法用来产生一个唯一的标示符,每次调用都会不一样,所以可以用当作一些临时缓存文件的名字 NSString *identifier = [[NSProcessInfo processInfo] gl ...

  3. python之正则表达式(re模块)用法总结

    用一句表示正则表达式,就是 字符串的模糊 匹配

  4. myeclipse2017使用总结

    1.之前的myeclipse 2010项目导入后,需要配置项目发布内容,否则class.lib.web.xml等文件不会自动发布到tomcat中:

  5. python生成接口自动化测试报告模版

    1:准备html模版 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> &l ...

  6. flask实现异步任务

    最近在开发同步mysql数据到redis的接口,因为数据同步涉及各种增删查改,如果用同步实现,可能回造成连接超时.堵塞,所以,使用python实现异步任务. 代码实现from flask import ...

  7. Java反射实现Servlet处理多个请求--server分发

    import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.serv ...

  8. Vim使用taglist功能

    下载 wget http://www.vim.org/scripts/download_script.php?src_id=19574 -O taglist.zip 然后解压taglist.zip到~ ...

  9. Java开发用H2数据库

    #JPA Configuration:#spring.jpa.database=MySQLspring.datasource.url=jdbc:h2:mem:jpaspring.datasource. ...

  10. python面试如何以相反顺序展示一个文件的内容?

    >>> for line in reversed(list(open('Today.txt'))): print(line.rstrip())containeritertools D ...