Linux history (Histroy) command logging filtering

Source: Internet
Author: User

The filtered directory is reached by setting an environment variable about the history command, and a timestamp can also be added.


The following methods can be added to the environment variable file to achieve permanent effect.


  1. To add a timestamp to a history command:

    1. Export histtimeformat= '%F%T '

  2. Search history using Ctrl+r.

  3. Number of historical command records

    1. Export histsize=450

    2. Export histfilesize=450

  4. Change the file of the Record History command,

    1. Export Histfile=/home/histroy_filename

  5. Remove consecutive duplicate commands from a file

    1. Export Histcontrol=ignoredups

  6. Remove all duplicate entries from the file

    1. Export Histcontrol=erasedups

  7. Set the command filter to not remember the command being filtered. When the terminal enters the command, enter a space in front of the command that you do not want to remember, in combination with alias.

    1. Export Histcontrol=ignorespace

8. Ignore remembering specific commands

    1. Export histignore= "Pwd:ls:ls-l:"
















Linux history (Histroy) command logging filtering

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.