• 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

Ubuntu 25.04 ‘Plucky Puffin’ Is Available To Download

How to Login as Root User in Linux Terminal

Install Firefox In Ubuntu Terminal Command Line

How To Check Kernel Installed Date In Linux Ubuntu

How To List All Kernel Modules That Are Loaded In Ubuntu

Enable Ubuntu Auto Login Without Password

Download Ubuntu 25.04 Official Default Wallpapers

How To Fix Initramfs Error In Ubuntu Command Line

How To Check All Available Kernel Version In Linux Ubuntu

3 Best Artificial Intelligence Domain Name Generators

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

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