File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,26 +13,26 @@ logout命令通常用于shell脚本中,表示正常结束当前的shell会话
1313
1414### 概要
1515
16- `shell
16+ ``` shell
1717logout [status]
18- `
18+ ```
1919
2020### 选项
2121
22- `shell
22+ ``` shell
2323--help 显示帮助信息并退出。
2424--version 显示版本信息并退出。
25- `
25+ ```
2626
2727### 参数
2828
29- `shell
29+ ``` shell
3030status 可选的退出状态码。如果不指定,默认返回上一个命令的退出状态。
31- `
31+ ```
3232
3333### 实例
3434
35- `shell
35+ ``` shell
3636# 在shell脚本中退出
3737#! /bin/bash
3838echo " 正在执行任务..."
@@ -49,19 +49,19 @@ logout
4949# 指定退出状态码
5050logout 0 # 正常退出
5151logout 1 # 异常退出
52- `
52+ ```
5353
5454### 相关命令
5555
5656- xit — 退出当前shell,功能与logout类似
5757- login — 登录到系统
5858- shutdown — 关闭系统
59- - eboot — 重启系统
59+ - eboot — 重启系统
6060
6161### 注意
6262
63631 . logout是bash等shell的内建命令,不是独立的可执行程序。
64642 . 在交互式登录shell中,logout的效果等同于exit。
65653 . 在shell脚本中,logout和exit的行为基本一致,都会终止脚本执行。
66664 . 如果想退出远程SSH会话,logout和exit都可以使用,也可以使用快捷键Ctrl+D。
67- 5 . logout命令不会关闭终端窗口本身,只会退出当前的shell会话。如果打开了嵌套的shell,可能需要多次执行logout才能完全退出。
67+ 5 . logout命令不会关闭终端窗口本身,只会退出当前的shell会话。如果打开了嵌套的shell,可能需要多次执行logout才能完全退出。
You can’t perform that action at this time.
0 commit comments