LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-30-2020, 10:49 AM   #1
no-windose
Member
 
Registered: Jun 2018
Posts: 98
Blog Entries: 2

Rep: Reputation: Disabled
How to get ALL bash history with a single command?


The history command as well as the upper arrow key gives you the bash history of the terminal you type from. If you have several opened terminals like several windows and/or non graphic terminals with Ctrl-F1 to Crtl-F6, you have to type from each and every terminal in order to get all your history.

Is there any way to get the history of all terminals from a single terminal?

Last edited by no-windose; 12-30-2020 at 10:54 AM.
 
Old 12-30-2020, 10:57 AM   #2
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
I had thought my .bashrc contained the answer for you but when I searched on "bash combine history" and came up with this link that shows how to do it, it came up with one extra piece I was missing the prompt part to do a re-read every time.

https://unix.stackexchange.com/quest...rminal-windows
 
1 members found this post helpful.
Old 12-30-2020, 12:20 PM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,786

Rep: Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216
With default settings, there is no single location that tracks the history for all your bash shells. Each bash process keeps its own history internally, initializing that list with the last $HISTSIZE lines from $HISTFILE. When an interactive shell exits, the last $HISTSIZE lines are copied from the history list to $HISTFILE. Unless the histappend shell option is set (by default it is not) an existing $HISTFILE is overwritten.

Last edited by rknichols; 12-30-2020 at 12:24 PM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash script to collect all mails of a local linux user and forwars all of them to a mail address as a single mail. Pheonix777 Linux - Server 12 04-11-2018 03:31 AM
Why does BASH history command have no history when run in script ? lump_of_lard Programming 4 01-30-2015 09:45 AM
[SOLVED] Is there any command to delete bash command history? cola Linux - Newbie 4 06-01-2010 07:32 AM
Bash history delete command from bash itself ashishag Linux - Software 6 05-02-2010 03:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration