Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit aec1d3c

Browse filesBrowse files
committed
add commands
1 parent aebe5ac commit aec1d3c
Copy full SHA for aec1d3c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

61 files changed

+5112
-0
lines changed
Open diff view settings
Collapse file

‎command/apropos.md‎

Copy file name to clipboard
+74Lines changed: 74 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
apropos
2+
===
3+
4+
在 whatis 数据库中查找字符串
5+
6+
## 补充说明
7+
8+
**apropos命令** 在一些特定的包含系统命令的简短描述的数据库文件里查找关键字,然后把结果送到标准输出。 
9+
10+
如果你不知道完成某个特定任务所需要命令的名称,可以使用一个关键字通过Linux apropos实用程序来搜索它。该实用程序可以搜索关键字并且显示所有包含匹配项的man页面的简短描述。另外,使用man实用程序和-k(关键字)选项,可以得到和用Linux apropos实用程序相同的结果(实际上是相同的命令)。
11+
12+
### 语法
13+
14+
```
15+
apropos [-dalhvV] -e|-[w|-r] [-s section] [-m system[,...]] [-M path] [-L locale] -C [file] keyword ...
16+
```
17+
18+
### 选项
19+
20+
```
21+
-d, --debug:输出调试信息。
22+
-v, --verbose:输出详细的警告信息。
23+
-r, -- regex:将每个keyword作为正则表达式解释。这是默认行为。每个keyword将匹配手册页和描述。
24+
-w, --wildcard:将每个keyword作为shell样式的通配符解释。
25+
-e, --exact:每个keyword将精确匹配手册页名字和描述。
26+
-a, --and:只显示匹配所有keyword的手册页和描述。默认显示匹配任何keyword的项。
27+
-l, --long:不根据终端宽度缩减输出。
28+
-s section, --section section:只查找指定的手册section。
29+
-m system[,...], --systems=system[,...]:用于查找其它操作系统的手册页。
30+
-M path, --manpath=path:指定从其它以冒号分隔的手册页层次查找。默认使用$MANPATH环境变量。这个选项覆盖$MANPATH的内容。
31+
-L locale, --locale=locale:apropos调用C函数setlocale来得到当前本地化信息,包括$LC_MESSAGE和$LANG。使用该选项提供一个locale字符串来临时更改本地化信息。
32+
-C file, --config-file=file:使用这个用户配置文件而不是默认的~/.manpath。
33+
-h, --help:打印帮助信息并退出。
34+
-V, --version:打印版本信息并退出。
35+
```
36+
37+
### 返回值
38+
39+
返回0表示成功,1表示用法、语法或配置文件错误,2表示操作错误,16表示没有找到匹配的内容。
40+
41+
### 实例
42+
43+
```
44+
[root@localhost ~]# man -k who
45+
at.allow [at] (5) - determine who can submit jobs via at or batch
46+
at.deny [at] (5) - determine who can submit jobs via at or batch
47+
jwhois (1) - client for the whois service
48+
jwhois (rpm) - Internet whois/nicname client.
49+
Net::LDAP::Extension::whoami (3pm) - LDAP Who am I? Operation
50+
w (1) - Show who is logged on and what they are doing
51+
who (1p) - display who is on the system
52+
who (1) - show who is logged on
53+
whoami (1) - print effective userid
54+
55+
[root@localhost ~]# apropos who
56+
at.allow [at] (5) - determine who can submit jobs via at or batch
57+
at.deny [at] (5) - determine who can submit jobs via at or batch
58+
jwhois (1) - client for the whois service
59+
jwhois (rpm) - Internet whois/nicname client.
60+
Net::LDAP::Extension::WhoAmI (3pm) - LDAP Who am I? Operation
61+
w (1) - Show who is logged on and what they are doing
62+
who (1p) - display who is on the system
63+
who (1) - show who is logged on
64+
whoami (1) - print effective userid
65+
```
66+
67+
查找手册页名字和描述中包含emacs和vi的手册页:
68+
69+
```
70+
apropos -a emacs vi
71+
```
72+
73+
74+
<!-- Linux命令行搜索引擎:https://jaywcjlove.github.io/linux-command/ -->
Collapse file

‎command/bg.md‎

Copy file name to clipboard
+39Lines changed: 39 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
bg
2+
===
3+
4+
用于将作业放到后台运行
5+
6+
## 补充说明
7+
8+
**bg命令** 用于将作业放到后台运行,使前台可以执行其他任务。该命令的运行效果与在指令后面添加符号`&`的效果是相同的,都是将其放到系统后台执行。
9+
10+
在Linux系统中执行某些操作时候,有时需要将当前任务暂停调至后台,或有时须将后台暂停的任务重启开启并调至前台,这一序列的操作将会使用到 jobs、bg、和 fg 三个命令以及两个快捷键来完成。
11+
12+
### 语法
13+
14+
```
15+
bg(参数)
16+
```
17+
18+
### 参数
19+
20+
作业标识:指定需要放到后台的作业标识号。
21+
22+
### 实例
23+
24+
使用bg命令将任务号为1的任务放到后台继续执行,输入如下命令:
25+
26+
```
27+
bg 1 #后台执行任务号为1的任务
28+
```
29+
30+
如果系统中只有一个挂起的任务时,即使不为该命令设置参数"1",也可以实现这个功能。
31+
32+
注意:实际上,使用bg命令与在指令后面添加符号"&"的效果是一样的。例如,使用`&``find / -name password`放到后台执行,输入如下命令:
33+
34+
```
35+
find / -name password & #后台执行任务
36+
```
37+
38+
39+
<!-- Linux命令行搜索引擎:https://jaywcjlove.github.io/linux-command/ -->
Collapse file

‎command/blkid.md‎

Copy file name to clipboard
+96Lines changed: 96 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
blkid
2+
===
3+
4+
查看块设备的文件系统类型、LABEL、UUID等信息
5+
6+
## 补充说明
7+
8+
在Linux下可以使用 **blkid命令** 对查询设备上所采用文件系统类型进行查询。blkid主要用来对系统的块设备(包括交换分区)所使用的文件系统类型、LABEL、UUID等信息进行查询。要使用这个命令必须安装e2fsprogs软件包。
9+
10+
### 语法
11+
12+
```
13+
blkid -L | -U
14+
blkid [-c ] [-ghlLv] [-o] [-s ][-t ] -[w ] [ ...]
15+
blkid -p [-s ] [-O ] [-S ][-o] ...
16+
blkid -i [-s ] [-o] ...
17+
```
18+
19+
### 选项
20+
21+
```
22+
-c <file> 指定cache文件(default: /etc/blkid.tab, /dev/null = none)
23+
-d don't encode non-printing characters
24+
-h 显示帮助信息
25+
-g garbage collect the blkid cache
26+
-o <format> 指定输出格式
27+
-k list all known filesystems/RAIDs and exit
28+
-s <tag> 显示指定信息,默认显示所有信息
29+
-t <token> find device with a specific token (NAME=value pair)
30+
-l look up only first device with token specified by -t
31+
-L <label> convert LABEL to device name
32+
-U <uuid> convert UUID to device name
33+
-v 显示版本信息
34+
-w <file> write cache to different file (/dev/null = no write)
35+
<dev> specify device(s) to probe (default: all devices)
36+
Low-level probing options:
37+
-p low-level superblocks probing (bypass cache)
38+
-i gather information about I/O limits
39+
-S <size> overwrite device size
40+
-O <offset> probe at the given offset
41+
-u <list> filter by "usage" (e.g. -u filesystem,raid)
42+
-n <list> filter by filesystem type (e.g. -n vfat,ext3)
43+
```
44+
45+
### 实例
46+
47+
1、列出当前系统中所有已挂载文件系统的类型:
48+
49+
```
50+
sudo blkid
51+
```
52+
53+
2、显示指定设备 UUID:
54+
55+
```
56+
sudo blkid -s UUID /dev/sda5
57+
```
58+
59+
3、显示所有设备 UUID:
60+
61+
```
62+
sudo blkid -s UUID
63+
```
64+
65+
4、显示指定设备 LABEL:
66+
67+
```
68+
sudo blkid -s LABEL /dev/sda5
69+
```
70+
71+
5、显示所有设备 LABEL:
72+
73+
```
74+
sudo blkid -s LABEL
75+
```
76+
77+
6、显示所有设备文件系统:
78+
79+
```
80+
sudo blkid -s TYPE
81+
```
82+
83+
7、显示所有设备:
84+
85+
```
86+
sudo blkid -o device
87+
```
88+
89+
8、以列表方式查看详细信息:
90+
91+
```
92+
sudo blkid -o list
93+
```
94+
95+
96+
<!-- Linux命令行搜索引擎:https://jaywcjlove.github.io/linux-command/ -->
Collapse file

‎command/builtin.md‎

Copy file name to clipboard
+38Lines changed: 38 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
builtin
2+
===
3+
4+
执行shell内部命令
5+
6+
## 补充说明
7+
8+
**builtin命令** 用于执行指定的shell内部命令,并返回内部命令的返回值。builtin命令在使用时,将不能够再使用Linux中的外部命令。当系统中定义了与shell内部命令相同的函数时,使用builtin显式地执行shell内部命令,从而忽略定义的shell函数。
9+
10+
### 语法
11+
12+
```
13+
builtin(参数)
14+
```
15+
16+
### 参数
17+
18+
shell内部命令:指定需要执行的shell内部命令。
19+
20+
### 实例
21+
22+
使用builtin命令执行shell内部命alias显示命令别名,输入如下命令:
23+
24+
```
25+
builtin alias #执行shell内部指令
26+
alias cp='cp -i'
27+
alias l.='ls -d .* --color=tty'
28+
alias ll='ls -l --color=tty'
29+
alias ls='ls --color=tty'
30+
alias mv='mv -i'
31+
alias rm='rm -i'
32+
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
33+
```
34+
35+
上面的命令执行后,将输出当前系统下的命令别名。
36+
37+
38+
<!-- Linux命令行搜索引擎:https://jaywcjlove.github.io/linux-command/ -->
Collapse file

‎command/command.md‎

Copy file name to clipboard
+35Lines changed: 35 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
command
2+
===
3+
4+
调用并执行指定的命令
5+
6+
## 补充说明
7+
8+
**command命令** 调用指定的指令并执行,命令执行时不查询shell函数。command命令只能够执行shell内部的命令。
9+
10+
### 语法
11+
12+
```
13+
command(参数)
14+
```
15+
16+
### 参数
17+
18+
指令:需要调用的指令及参数。
19+
20+
### 实例
21+
22+
使用command命令调用执行`echo Linux`,输入如下命令:
23+
24+
```
25+
command echo Linux #调用执行shell内部指令
26+
```
27+
28+
上面的命令执行后,将调用执行命令`echo Linux`,其执行结果如下:
29+
30+
```
31+
Linux
32+
```
33+
34+
35+
<!-- Linux命令行搜索引擎:https://jaywcjlove.github.io/linux-command/ -->

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.