Skip to content

Commit b434fa2

Browse files
committed
doc: update command/logout.md #696
1 parent c39f564 commit b434fa2

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

command/logout.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,26 @@ logout命令通常用于shell脚本中,表示正常结束当前的shell会话
1313

1414
### 概要
1515

16-
`shell
16+
```shell
1717
logout [status]
18-
`
18+
```
1919

2020
### 选项
2121

22-
`shell
22+
```shell
2323
--help 显示帮助信息并退出。
2424
--version 显示版本信息并退出。
25-
`
25+
```
2626

2727
### 参数
2828

29-
`shell
29+
```shell
3030
status 可选的退出状态码。如果不指定,默认返回上一个命令的退出状态。
31-
`
31+
```
3232

3333
### 实例
3434

35-
`shell
35+
```shell
3636
# 在shell脚本中退出
3737
#!/bin/bash
3838
echo "正在执行任务..."
@@ -49,19 +49,19 @@ logout
4949
# 指定退出状态码
5050
logout 0 # 正常退出
5151
logout 1 # 异常退出
52-
`
52+
```
5353

5454
### 相关命令
5555

5656
- xit — 退出当前shell,功能与logout类似
5757
- login — 登录到系统
5858
- shutdown — 关闭系统
59-
- eboot — 重启系统
59+
- eboot — 重启系统
6060

6161
### 注意
6262

6363
1. logout是bash等shell的内建命令,不是独立的可执行程序。
6464
2. 在交互式登录shell中,logout的效果等同于exit。
6565
3. 在shell脚本中,logout和exit的行为基本一致,都会终止脚本执行。
6666
4. 如果想退出远程SSH会话,logout和exit都可以使用,也可以使用快捷键Ctrl+D。
67-
5. logout命令不会关闭终端窗口本身,只会退出当前的shell会话。如果打开了嵌套的shell,可能需要多次执行logout才能完全退出。
67+
5. logout命令不会关闭终端窗口本身,只会退出当前的shell会话。如果打开了嵌套的shell,可能需要多次执行logout才能完全退出。

0 commit comments

Comments
 (0)