一天一条linux命令之history

来源:岁月联盟 编辑:exp 时间:2012-05-11

一天一条linux命令之history history命令的功能是显示使用过的命令,并为其编号。 history n 显示最近使用过的n条命令。  www.2cto.com   history -c 将当前shell中历史清空。 history -d 801 删除编号为801的命令。 history -a 追加最新一条命令到历史文件中。 history -n 显示还没有从历史文件中读取的历史记录。 history -r 将历史文件中的记录作为当前shell的历史记录。 history -w 将当前记录写入历史文件中,覆盖原内容。 -p Perform history substitution on the following args anddisplay the result on the standard output. Does notstore the results in the history list. Each arg must bequoted to disable normal history expansion.  www.2cto.com   -s Store the args in the history list as a single entry.The last command in the history list is removed beforethe args are added. !! 执行上一条命令。!n 执行第n条命令。!cd 执行最近一条以cd开头的命令。!与后面都没有空格。   作者 CrazyNemo