如果是直接用普通用户($)的身份进行输入[user@localhost ~]$ shutdown -h -t 是不能执行,因为普通用户没有关闭机器的权限。

然而直接使用[user@localhost ~]$ su 也是不行的。而是要使用[user@localhost ~]$ su - root ;

su命令和su - 命令最大的本质区别就是:前者只是切换了root身份,但Shell环境仍然是普通用户的Shell;而后者连用户和Shell环境一起切换成root身份了。只有切换了Shell环境才不会出现PATH环境变量错误。su切换成root用户以后,pwd一下,发现工作目录仍然是普通用户的工作目录;而用su -命令切换以后,工作目录变成root的工作目录了。用echo $PATH命令看一下su和su -以后的环境变量有何不同。以此类推,要从当前用户切换到其它用户也一样,应该使用su -命令。---来自 http://www.ha97.com/4001.html

为什么输入shutdown -h -t会报错:command not fount的更多相关文章

  1. Robotframework学习笔记之—Rrobotframework运行报错“command: pybot.bat --argumentfile”

    Rrobotframework运行报错"command: pybot.bat --argumentfile" 解决方案: 1.可能是缺失文件: 1.1.检查python安装目录下的 ...

  2. 在MacOS下Python安装lxml报错xmlversion.h not found 报错的解决方案

    最近在看一个自动化测试框架的问题,需要用到Lxml库,下载lxml总是报错. 1,使用pip安装lxml pip install lxml 2,然后报错了,报错内容是: In file include ...

  3. 阿里云服务器tomcat ./shutdown.sh关闭命令报错Could not contact localhost:8005. Tomcat may not be running.

    JDK1.8运行./shutdown 停止tomcat报错: 昨天购买了一个阿里云服务器,由于时间问题今天才来启动tomcat,启动的时候才发现跟我以前使用的服务器不太一样,去网上搜索了半天以为是to ...

  4. Tomcat启动慢(运行shutdown.sh的时候报错)

    Using CATALINA_BASE: /usr/local/tomcatUsing CATALINA_HOME: /usr/local/tomcatUsing CATALINA_TMPDIR: / ...

  5. 安装 xadmin 报错: Command "python setup.py egg_info" failed with error code 1 in C:\Users\Python\AppData\Local\Temp\pip-install-1k1byg0p\xadmin\

    报错详情 安装 xadmin 组件的时候报错 不论是命令行还是 pycharm 方式都不行 分析报错 按照报错提示是说 README.rst 文件的编码问题导致. 解决报错 通过 github 下载源 ...

  6. vue-create 报错 command failed: yarn --registry=https://registry.npm.taobao.org --disturl=https://npm.taobao.org/dist 完美解决方案

    @vue/cli 3.x 创建项目失败解决方案 报错信息 command failed: yarn --registry=https://registry.npm.taobao.org --distu ...

  7. python下pip 安装 pyautogui报错Command "python setup.py egg_info" failed with error code 1 in C:\Users\Administrator\AppData\Local\Temp\pip-install-svhtepho\pygetwindow\

    python装的3.6 64位,使用命令pip install pyautogui 或者pip install -U pyautogui 都失败了 报错如下: Command "python ...

  8. Idea debug报错Command line is too long

    问题: 使用idea开发Java项目,写单元测试,debug时,会有红字报错:Command line is too long 解决方法: 在项目的目录下,找到/.idea/workspace.xml ...

  9. xcode 运行报错 Command /usr/bin/codesign failed with exit code 1

           因为更换了证书,导致在运行时报错 Command /usr/bin/codesign failed with exit code 1,查看了网上各种方法,最后发现以下两个值没有同步更新

随机推荐

  1. java中的Timer

    一个java中用Timer做的简单定时器小程序. package com.test.lx; import java.util.TimerTask; public class TimeTaskTest ...

  2. 口红游戏 插口红游戏 h5页面开发

    目前火热的口红机游戏,需要在设备前参与,然后成功后即可赢得口红,作为平台运营者来说还是比较重资产的,目前我们将它搬到了线上.每个人都可以远程玩这样的口红机游戏了.直接在手机微信里试玩,成功后,后台即可 ...

  3. python使用openpyxl操作excel

    def initExcel(): file_path = "test.xlsx" file = load_workbook(file_path) table = file[&quo ...

  4. linq使用 count与sum等

    using System; using System.Data; using System.Configuration; using System.Linq; using System.Web; us ...

  5. LVDS 数据通道详解 单8 单6

    1.1.1           LVDS接口分类 1.1.1.1              单路6bit LVDS 这种接口电路中,采用单路方式传输,每个基色信号采用6位数据,共18位RGB数据,因此 ...

  6. 非常好!!!---bash转义序列笔记---打印语句printf用法【转】

    转自:http://bbs.chinaunix.net/forum.php?mod=viewthread&tid=2318684&fromuid=23571134 本教程由 惟吾无为 ...

  7. 流畅的python第九章笔记 python风格的python

    9.1对象表示形式 __repr__和__str__这两个方法都是用于显示的,__str__是面向用户的,而__repr__面向程序员. 我们打印下面的A是默认输出这个对象的类型,我们对B进行了修改_ ...

  8. 基于UDP高性能传输协议UDT doc翻译(一)

    原文转自:http://hi.baidu.com/doodlezone/item/74a203155efe26dbbf9042dd                  UDT文档阅读理解 一.  概述 ...

  9. ubuntu 更换系统源和pip源

    1 . 备份 cd /etc/apt sudo cp sources-list sources-list.bak 2 . 编辑 这里用了阿里云的源 sudo vi sources-list 将文件内容 ...

  10. cloudflare 301 重定向设置

    https://support.cloudflare.com/hc/en-us/articles/218411427#redirects 将 https://dfg.com/* 设置301重定向到 h ...