分享

linux内置命令

 风雨孤剑客 2023-08-12 发布于新疆

查看所有内置命令

方法1:help

方法2:compgen -b

compgen:显示所有可用的命令、别名和函数

-c 列出所有可用的命令

-a 列出可用的所有bash shell别名

-b 显示所有bash内置插件

-k 显示所有bash关键字

-A 显示所有bash函数

方法1:

可以配合管道符分页查看:

help | less 
help | more

方法2:

geoff@Geoff:~$ compgen -b
.
:
[
alias
bg
bind
break
builtin
caller
cd
command
compgen
complete
compopt
continue
declare
dirs
disown
echo
enable
eval
exec
exit
......

查看内置命令详情

语法:help 命令名称

geoff@Geoff:~$ help exit
exit: exit [n]
    Exit the shell.

    Exits the shell with a status of N.  If N is omitted, the exit status
    is that of the last command executed.

判断命令类型

type 命令名

或:

command -V 命令名

geoff@Geoff:~$ type echo
echo is a shell builtin

geoff@Geoff:~$ command -V echo
echo is a shell builtin



    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多