linux-命令学习-type which whereis who w
1.type
用来显示指定命令的类型。
用法:
type COMMAND
命令的类型如下:
- alias 别名
- keyword 关键字,Shell保留字
- function 函数,Shell函数
- builtin 内建命令,Shell内建命令
- file 文件,磁盘文件,外部命令
- unfound 没有找到
用来显示命令的路径。
用法
which [options] [--] programname [...]
--skip-alias :忽略别名
which --skip-alias ls
定位可执行文件、源代码文件、帮助文件在文件系统中的位置,这些文件的属性应属于原始代码,二进制文件,或是帮助文件。
用法
whereis [options] name ...
-b:仅搜索二进制程序路径;
-m:仅搜索使用手册文件路径
4.who
简单显示当前登录系统用户的信息,可以轻松的获取当前登录系统的用户列表,包含使用终端登录。
用法
whereis [options]
-a:显示所有用户的所有信息
-b:系统此次启动的时间;
-H:显示表头
-r:运行级别
5.w
用来查看登录者的信息及他们的行为。
用法
w -[husFV] username
-h:不显示标题
-u:列出当前进程和CPU时间时或略用户名,主要用于执行su命令的情况
-s:简介模式;
-f:切换显示FROM项,默认不显示远程主机
-V:显示版本信息