Working with Commands

Working with Commands

commands can be one of four different things:
- an executable program.
- a command built into the shell itself.
- a shell function.
- an alias.

type

display a command’s type,command is the name that you want to examine.

type command

which

dispaly an executable’s location.Only works for executable program,not builtins and aliases

which ls
#will show /bin/ls
which cd
#cd is a shell builtin command,can't use which

what is

display the name and one line description of a man page matching a specified keyword.

whatis ls
#will show  "ls         (1) - list directory contents"

alias

Using the alias command,we can create our own command.

alias foo='cd /usr;ls -alh;cd -'

then you can use the foo command,it’s function is to change the directory to /usr,then ls and return to the previous directory.
Also,you can remove the alias command using unalias command:

unalias foo
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值