Linux命令 systemctl su (ubuntu)

压缩

tar

zip

搜索内容

grep


查看空间使用

df -lh

查看sudo权限

查看自己账号的sudo权限

sudo -l

切换用户

systemctl


修改 xxx.service文件后刷新服务

systemctl daemon-reload

启动某服务

systemctl start   tomcat.service

停止某服务

systemctl stop   tomcat.service

重启某服务

systemctl restart  tomcat.service

使某服务自动启动(如tomcat服务)

systemctl enable   tomcat.service

使某服务不自动启动

systemctl disable   tomcat.service

检查服务状态

systemctl   status tomcat.service (服务详细信息)

systemctl   is-active tomcat.service(仅显示是否Active)

显示所有已启动的服务

systemctl list-units --type=service

启动

systemctl start(也可以使用service start)

查看状态

syatemctl status dockers


su (ubuntu)

su: Authentication failure报错

这个问题产生的原因是由于ubtun系统默认是没有激活root用户的,需要我们手工进行操作,在命令行界面下,或者在终端中输入如下命令:

sudo passwd

Password:你当前的密码

Enter new UNIX password:这个是root的密码

Retype new UNIX password:重复root的密码

然后会提示成功的信息。

在说明一点,使用su和sudo是有区别的,使用su切换用户需要输入所切换到的用户的密码,而使用sudo则是当前用户的密码。

切换用户的命令是su,su是(switch user)切换用户的缩写。通过su命令,可以从普通用户切换到root用户,也可以从root用户切换到普通用户。从普通用户切换到root用户需要密码(该密码是普通用户的密码),从root用户切换到普通用户不需要密码。


查看进程

ps -ef | grep java

ps是查看进程  -e显示全部进程 f全格式。 grep为管道进行过滤用

windows 过滤   | findstr str    linux过滤   | grep str

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章