命令别名设定:alias,unalias
lee@lee-pc:~$ lm
lm:找不到命令
lee@lee-pc:~$ alias lm='ls -al|more'
lee@lee-pc:~$ lm
总用量 268
drwxr-xr-x 40 lee lee 4096 2013-10-11 09:43 .
drwxr-xr-x 4 root root 4096 2012-05-09 00:18 ..
drwx------ 3 lee lee 4096 2013-09-06 20:45 .adobe
-rw------- 1 lee lee 7221 2013-10-10 19:00 .bash_history
-rw-r--r-- 1 lee lee 220 2012-05-09 00:18 .bash_logout
-rw-r--r-- 1 lee lee 3353 2012-05-09 00:18 .bashrc
drwx------ 21 lee lee 4096 2013-10-08 16:02 .cache
......
取消设定:
lee@lee-pc:~$ unalias lm
lee@lee-pc:~$ lm
lm:找不到命令
lee@lee-pc:~$
历史命令:history
history [n]
history [-c]
history [-raw] histfiles
选项与参数:
n:列出最近的n条命令列表
lee@lee-pc:~$ history 5
766 lm
767 unalias lm
768 lm
769 history
770 history 5
lee@lee-pc:~$
-c:将目前的shell中的所有history内容全部消除
-a:将目前新增的history指令新增入histfiles中,若没有加histfiles.
-r:将histfiles的内容读到目前这个shell的history中。
-w:将目前的history记忆内容写入histfiles中。
lee@lee-pc:~$ lm
lm:找不到命令
lee@lee-pc:~$ alias lm='ls -al|more'
lee@lee-pc:~$ lm
总用量 268
drwxr-xr-x 40 lee lee 4096 2013-10-11 09:43 .
drwxr-xr-x 4 root root 4096 2012-05-09 00:18 ..
drwx------ 3 lee lee 4096 2013-09-06 20:45 .adobe
-rw------- 1 lee lee 7221 2013-10-10 19:00 .bash_history
-rw-r--r-- 1 lee lee 220 2012-05-09 00:18 .bash_logout
-rw-r--r-- 1 lee lee 3353 2012-05-09 00:18 .bashrc
drwx------ 21 lee lee 4096 2013-10-08 16:02 .cache
......
取消设定:
lee@lee-pc:~$ unalias lm
lee@lee-pc:~$ lm
lm:找不到命令
lee@lee-pc:~$
历史命令:history
history [n]
history [-c]
history [-raw] histfiles
选项与参数:
n:列出最近的n条命令列表
lee@lee-pc:~$ history 5
766 lm
767 unalias lm
768 lm
769 history
770 history 5
lee@lee-pc:~$
-c:将目前的shell中的所有history内容全部消除
-a:将目前新增的history指令新增入histfiles中,若没有加histfiles.
-r:将histfiles的内容读到目前这个shell的history中。
-w:将目前的history记忆内容写入histfiles中。