Linux under the history command little note

Source: Internet
Author: User

1,histtimeformat display user name and time

# export histtimeformat= "' WhoAmI '%F%T"

# History | Tail

1032 Root 2015-05-28 13:57:22 ll

1033 Root 2015-05-28 13:57:26 pwd


2,histsize Total Row count of the control history command

# Export histsize=2000

# Export histfilesize=2000

Histsize

Defines the number of records for the history command output

Histfilesize

Defines the total number of records to save a command in file ~/.bash_history


3,histfile changing the history file name

# Export Histfile=/root/.root_history


4,histcontrol clear successive duplicates in the history command

# Export Histcontrol=ignoredups


5,histcontrol clear duplicate entries in the entire command history

# Export Histcontrol=erasedups


6, clear all command history using the-C option

# history-c


7,histignore ignoring specific commands in history

# Export histignore= "pwd:ls:ls-ltr:"

This article is from the "Linuxdream" blog, make sure to keep this source http://books.blog.51cto.com/2600359/1656100

Linux under the history command little note

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.