• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Source Digit

Source Digit

Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • How To
  • Ubuntu
  • Instagram
  • Blogging
  • Android
  • WordPress
  • +More
    • Cloud Computing
    • Gadgets
    • Social Media
    • Technology
  • Write for Us
Home / How To / How to Clear Terminal History In Ubuntu

How to Clear Terminal History In Ubuntu

By Sourabh / September 29, 2015 Category: How To, Ubuntu

Learn how to clear Terminal history in Ubuntu. You can clear bash shell history, which means you can clear previous command history from Ubuntu Terminal.

Clear Bash Shell Terminal History Command

To clear the history, type the following command:
history -c && history -w
OR
rm ~/.bash_history

Clear Bash Shell Terminal History on Logout

You can modify the above command to clear the history when you logout:

echo 'history -c' >> ~/.bash_logout

Never Save Bash History File

You can prevent a bash history file from ever being saved. To do so, add the following commands to ~/.bashrc file:


echo 'unset HISTFILE' >> ~/.bashrc
echo 'export LESSHISTFILE="-"' >> ~/.bashrc

Where is Terminal History stored in Ubuntu ?

The Terminal history is stored in a file called “.bash_history” located in the home directory. The file can be edited manually or removed completely by typing the following command in the terminal.


rm ~/.bash_history

Tags: Clear bash shell history, Clear bash shell history command, Clear Bash Shell Terminal Commands History on Logout, Clear Shell History In Ubuntu Linux, Clear Terminal Commands History Linux, Clear Terminal Commands History Ubuntu, clearn Terminal command history, Clearn Terminal History in Ubuntu, Clearn Terminal history Ubuntu, clearn Terminal screen, Command clear bash shell history, Delete Terminal Commands History Linux, Delete Terminal Commands History Ubuntu, Delete Terminal History Ubuntu, How To Clear Bash History Completely?, How To Clear Previous Command History From Ubuntu Terminal, How To Clear The Terminal Command History, Linux, Linux Clear Terminal Commands History, Linux Delete Terminal Commands History, Linux Remove Terminal Commands History, Remove Terminal Commands History Linux, Remove Terminal Commands History Ubuntu, Terminal, Terminal clear Bash sheel history, Terminal History stored in Ubuntu, Tricks Ubuntu Terminal, Ubuntu 14.04, Ubuntu 14.10, Ubuntu clear bash history, Ubuntu Clear Terminal Commands History, Ubuntu clear terminal shortcut, Ubuntu Delete Terminal Commands History, Ubuntu Remove Terminal Commands History, Ubuntu terminal clear screen, Ubuntu Terminal Tips, Ubuntu Terminal Tricks

Primary Sidebar

Latest Posts

Downlaod Ubuntu 26.10 Stonking Stingray

How To Shutdown Linux With A 15 Minute Delay And Message

Using Linux Terminal How To Get Total Disk Size In GB

Count And Find Number Of Files In A Linux Directory Using Command

Check How Many Users Are Created In Linux Ubuntu

How To Check User Permissions In Linux Using Command

Check Which Folder Is Taking More Space In Ubuntu Linux

How to Install Claude Desktop App in Ubuntu Linux

Job Scheduling Using At Command In Linux With Examples

How To Check Permissions Of A Directory In Linux Command

© 2026 Source Digit • Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • About
  • Privacy Policy
  • Terms & Conditions
  • Contact Us
  • Sitemap