清除Linux作業系統命令的歷史記錄

2021-06-29 08:44:57 字數 750 閱讀 3051

步驟如下:

1、建立乙個檔案來儲存常用命令,例如/root/history.txt,把常用命令當成文字寫進去,每個命令佔一行

2、在終端執行history -c,清除雜亂的歷史記錄

3、執行history -r /root/history.txt,把命令讀進來作為當前bash的歷史記錄

4、執行history,就得到乙個整潔的命令列表了,例如:

[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、以後命令亂了,重複1-4的步驟,又可以使命令很清晰了。

Windows Windows作業系統的歷史

1983年 比爾 蓋茨宣布微軟視窗1983年11月10日。1985年 microsoft windows 1.0在1985年11月20日介紹,並初步售價為 100,00。1987年 microsoft windows 2.0發布1987年12月9日和最初售價為 100,00。1987年 micros...

如何清除Linux作業系統命令的歷史記錄

步驟如下 1 建立乙個檔案來儲存常用命令,例如 root history.txt,把常用命令當成文字寫進去,每個命令佔一行 2 在終端執行history c,清除雜亂的歷史記錄 3 執行history r root history.txt,把命令讀進來作為當前bash的歷史記錄 4 執行histor...

linux作業系統基礎命令

gcc的知識要點 gcc的初衷是為gnu作業系統專門編寫的一款編譯器,gnu系統是徹底自由的軟體。gcc的基本用法 gcc hello world.c c,只編譯,不鏈結成為可執行檔案,編譯器只是由輸入的.c的源 檔案生成.o為字尾檔案的目標檔案,通常用於編譯不包括主程式的子程式。gcc hello...