type – 命令的类型
命令有4种形式
- 可执行程序
- shell内部命令
- shell函数
- 命令别名
$ type type
type is a shell builtin
$ type ls
ls is aliased to `ls --color=auto'
$ type cp
cp is /bin/cp
which – 显示可执行程序的位置
$ which ls
/bin/ls
help&&man&&apropos&&info – 显示帮助
$ help cd
$ mkdir --help
$ man ls
$ man 5 passwd --/etc/passwd文件格式说明手册
$ man -k floppy
fdformat (8) - low-level format a floppy disk
mbadblocks (1) - tests a floppy disk, and marks the bad blocks in the FAT
mformat (1) - add an MSDOS filesystem to a low-level formatted floppy disk
mxtar (1) - Wrapper for using GNU tar directly from a floppy disk
$ apropos floppy
fdformat (8) - low-level format a floppy disk
mbadblocks (1) - tests a floppy disk, and marks the bad blocks in the FAT
mformat (1) - add an MSDOS filesystem to a low-level formatted floppy disk
mxtar (1) - Wrapper for using GNU tar directly from a floppy disk
格式为:手册页的名字 显示章节
$ info ls // 查看info手册
在/usr/share/doc目录下,是系统软件的文档文件:
- 文本格式:less阅读
- HTML格式:网页浏览器阅读
- *.gz文件,可以使用zless来显示这些有gzip压缩的文本文件的内容
alias–给命令起别名
$ type foo
bash: type: foo: not found
$ alias foo='cd /usr/; ls;cd'
$ type foo
foo is aliased to `cd /usr/; ls;cd'
$ foo
bin games include lib libexec local sbin share src
$ unalias foo
$ type foo
bash: type: foo: not found