linux history存储,history能保存多少命令

wywrw0512 于 2010-11-01 16:59:29发表:

好,支持

hbhychl 于 2010-10-06 16:11:53发表:

新手报到

hbhychl 于 2010-10-06 16:11:50发表:

默认总的行数为1000,行号应该是动态的吧,不是很明白。

olderlong 于 2010-10-05 21:15:26发表:

默认总的行数为1000,行号应该是动态的吧,不是很明白。

gondn125 于 2010-10-05 07:55:59发表:

try this command ~: .history | wc -l

Linux-L 于 2010-09-29 23:08:58发表:

6# 相思爱文

学习啦

llreg126 于 2010-09-29 21:55:15发表:

我也想知道。。。

相思爱文 于 2010-09-29 19:37:44发表:

显示总数是1000,但序号不总是从1 开始的。超过1000个,前面的就会不显示,但序号保留。

如运行过1046个命令,那序号就是从47开始

可用

history >h.txt

less h.txt

看看

allen_fu 于 2010-09-29 13:05:35发表:

是因为文件中已经存了1000个命令了,但内存中还有你今天输入的还未保存到文件中去的几十个命令。(个人猜想未实验的,不晓得对不对,对的话告诉我一下)

alick 于 2010-09-29 13:04:55发表:

继续上面的执行history | head第一个应该就是3了。

昊昊荡荡 于 2010-09-29 10:48:45发表:

引用:

history | head看看第一个命令的编号。

我猜测是因为shell不想每执行了一条新的命令就要把命令编号都做一修改

alick 发表于 2010-9-29 10:41 back.gif

不需要修改每条命令的编号吧,像堆栈一样,新加入的命令编号增加1就行了

[root@fedora13 ~]# history | head

1 ;s

2 ls

3 cd Tencent/

4 ls

5 cd QQ

6 ls

7 cd Bin/

8 ls

9 wine QQ.exe

10 cd /

[root@fedora13 ~]# history | tail

990 cp /media/YUAN/Qomo-1.0.0-i686-Live.iso /home/wuhaoshu/os/

991 ls /home/wuhaoshu/os/

992 meminfo

993 find / -name proc

994 more /proc/meminfo

995 shutdown -h +5

996 shutdown -h now

997 history

998 history | head

999 history | tail

[root@fedora13 ~]# ls

anaconda-ks.cfg install.log install.log.syslog remotedek.sh

[root@fedora13 ~]# history | tail

992 meminfo

993 find / -name proc

994 more /proc/meminfo

995 shutdown -h +5

996 shutdown -h now

997 history

998 history | head

999 history | tail

1000 ls

1001 history | tail

[root@fedora13 ~]#

alick 于 2010-09-29 10:41:32发表:

[code]history | head[/code]看看第一个命令的编号。

我猜测是因为shell不想每执行了一条新的命令就要把命令编号都做一修改

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值