巴什历史不带行号? [英] Bash history without line numbers?

查看:116
本文介绍了巴什历史不带行号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

bash的历史命令是非常冷静。我明白为什么它显示的行数,但有一种方法,我可以调用历史命令和SUP preSS的行号?

The bash history command is very cool. I understand why it shows the line numbers, but is there a way I can invoke the history command and suppress the line numbers?

这里的关键是使用history命令,所以请不要回复猫〜/ .bash_history的

The point here is to use the history command, so please don't reply cat ~/.bash_history

电流输出:

  529 man history
  530 ls
  531 ll
  532 clear
  533 cd ~
  534 history

历史图形源。

所需的输出:

man history
ls
ll
clear
cd ~
history

历史图形源。

感谢大家为你的伟大的解决方案。保罗是最简单的,并会为我工作,因为我的bash的历史记录大小设置为2000年。

Thanks to everyone for your great solutions. Paul's is the simplest and will work for me for because my bash history size is set at 2000.

我也想分享一个很酷的文章,我今天早上发现。它有我现在用的,喜欢养重复条目出bash的历史,并确保多的bash会话不会覆盖历史文件一对夫妇不错的选择:<一href=\"http://blog.macromates.com/2008/working-with-history-in-bash/\">http://blog.macromates.com/2008/working-with-history-in-bash/

I also wanted to share a cool article I found this morning. It has a couple good options that I am now using, like keeping duplicate entries out of the bash history and making sure multiple bash sessions don't overwrite the history file: http://blog.macromates.com/2008/working-with-history-in-bash/

推荐答案

试试这个:

$ history | cut -c 8-

这篇关于巴什历史不带行号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆