How to clear the history of Linux operating system commands

Source: Internet
Author: User

The steps are as follows:

1, create a file to store commonly used commands, such as/root/history.txt, write the common commands as text, each command occupies one line

2, run history-c in the terminal, clean up the messy history record

3, run History-r/root/history.txt, read the command as the history of the current bash

4, run history, you get a neat list of commands, such as:

[Root@localhost windata]# History-c

[Root@localhost windata]# history-r/root/history.txt

[Root@localhost windata]# History

1 History-r/root/history.txt

2 mount-t msdos-o Iocharset=gb2312/dev/sda1/mnt/usb

3 Mount-t Vfat-o Iocharset-gb2312/dev/hda5/mnt/windata

4 Umount/mnt/windata

5 mount-t Vfat-o Iocharset-gb2312/dev/hda5/mnt/windata

6 Cd/mnt/windata

7 history

[Root@localhost windata]#

5, after the chaos of the order, repeat the 1-4 steps, but also to make the command very clear.

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.