---
title: "查看历史命令，并显示运行时间"
author: "daizj"
date: "2021-09-01T14:40:00Z"
tags: []
categories: ["操作系统"]
slug: "untitled"
draft: false
lastmod: "2021-09-01T14:40:00Z"
id: 2520892
url: "https://daizj.iteye.com/blog/2520892"
---

查看历史运行命令及时间
通常使用history来查看历史运行的命令，直接输入此命令，只会显示运行的命令，没有显示在什么时间运行的，如果要查看运行命令的时间，具体方法通过下面两步就可以显示：

1.export HISTTIMEFORMAT='%F %T '

2.history|grep start