Page 1 of 3 123 LastLast
Results 1 to 10 of 30

Thread: recent terminal commands

  1. #1

    Default recent terminal commands

    This is a question about Konsole or any command line terminal that allows the user to use the arrow pad [left,right,up,down] to recall recently used commands.
    I am not exactly sure but I think it stores up to 15 of the most recent commands.
    My questions are:
    1]Where are these commands stored?
    2]Can I get to them and delete/clear the list?
    I have poked about in Konsole task bar and settings but have found nothing [that I think] relates to this.

    Should I be posting this elsewhere?

    thanks
    Last edited by LaQuirrELL; 21-Jan-2014 at 08:51. Reason: spelling
    Machine # 1 - Asus Prime Z390A, i7-9700k 3.6GHz, 32.0 GB ram, openSUSE Leap 15.0 64-bit, KDE Plasma 5.12.8
    Machine # 2 - Asus P8Z77-V Deluxe, i7-3770k 3.5GHz, 16.0 GB ram, Debian 10 Buster 64-bit, LXDE

  2. #2

    Default Re: recent terminal commands

    Terminals may do this, but the default shell 'bash' definitely does. The
    history is, by default, 1000 commands long, but that's something you can
    extend. Using the up arrows, or Ctrl+r, or '!', or a number of other
    things, can retrieve commands. The 'history' command will also retrieve
    all commands in the history, as well as clear the history. They are
    stored in ~/.bash_history as I recall. See the 'bash' manpage for more.

    --
    Good luck.

    If you find this post helpful and are logged into the web interface,
    show your appreciation and click on the star below...

  3. #3
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,268
    Blog Entries
    2

    Default Re: recent terminal commands


    Whenever I do a live presentation using Konsole and people see me scrolling to see the previous history (it's almost certainly stored in a memory buffer, not on disk) I always hear a gasp in the audience.

    People who are used to working in many other distros do <not> get this feature by default in their terminals, so I generally then pause for a moment and explain a little about the enhanced features provided by Konsole.

    TSU

  4. #4

    Default Re: recent terminal commands

    tsu2 wrote:
    >
    > Whenever I do a live presentation using Konsole and people see me
    > scrolling to see the previous history (it's almost certainly stored in a
    > memory buffer, not on disk) I always hear a gasp in the audience.
    >
    > People who are used to working in many other distros do <not> get this
    > feature by default in their terminals, so I generally then pause for a
    > moment and explain a little about the enhanced features provided by
    > Konsole.


    I don't use KDE, but what are we talking about here?

    In my experience, command history is provided by the shell, not the
    terminal. If Konsole has command history using up arrow etc, how does
    that work with bash's history using up arrow etc? A quick google showed
    the first hit being somebody confusing the two, so is there a reference
    for such a Konsole feature? I don't see it in the Konsole manual.

    In my experience, terminals usually provide history of the whole
    session, both input and output. That's what the Konsole manual
    describes, but every terminal since xterm has that feature, AFAIK.

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,124

    Default Re: recent terminal commands

    I support this. Command retrieval is a shell feature. It worked already with dumb TTYs, thus it is not a terminal emulator (Konsole, XTerm, ....) feature.
    Henk van Velden

  6. #6
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,268
    Blog Entries
    2

    Default Re: recent terminal commands

    Ummm...
    Maybe a bit of clarification here.

    I was not referring to the "up arrow" that cycles through previous commands but the fact that Konsole supports using the mouse to scroll the window to display previous commands and output. And, AFAIK this is purely a Konsole enhancement of the underlying BASH.

    My bad if the Q was about something different.

    TSU

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,124

    Default Re: recent terminal commands

    Quote Originally Posted by tsu2 View Post
    Ummm...
    Maybe a bit of clarification here.

    I was not referring to the "up arrow" that cycles through previous commands but the fact that Konsole supports using the mouse to scroll the window to display previous commands and output. And, AFAIK this is purely a Konsole enhancement of the underlying BASH.

    My bad if the Q was about something different.

    TSU
    This was the first sentence of the OP:
    This is a question about Konsole or any command line terminal that allows the user to use the arrow pad [left,right,up,down] to recall recently used commands.
    Henk van Velden

  8. #8
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: recent terminal commands

    On 2014-01-21 18:10, Dave Howorth wrote:
    > In my experience, terminals usually provide history of the whole
    > session, both input and output. That's what the Konsole manual
    > describes, but every terminal since xterm has that feature, AFAIK.


    Correct.

    And if you use, say, 20 terminals of mixed type, and reboot or log out,
    on the next terminal you open (even text mode console) you see a mixture
    of all the commands you typed on the previous session.

    Trick: if you precede your command with an space, it is not saved to the
    history, it is lost.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.3 x86_64 "Dartmouth" at Telcontar)

  9. #9
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: recent terminal commands

    On 2014-01-21 20:56, tsu2 wrote:
    >
    > Ummm...
    > Maybe a bit of clarification here.
    >
    > I was not referring to the "up arrow" that cycles through previous
    > commands but the fact that Konsole supports using the mouse to scroll
    > the window to display previous commands and output. And, AFAIK this is
    > purely a Konsole enhancement of the underlying BASH.
    >
    > My bad if the Q was about something different.


    Yes, that's a different feature, but all terminals have something
    similar, too. Even on text mode console, you can use "shift-page-up" to
    view it. But it is cleared as soon as you switch consoles.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.3 x86_64 "Dartmouth" at Telcontar)

  10. #10
    Join Date
    Jun 2008
    Location
    West Yorkshire, UK
    Posts
    3,450

    Default Re: recent terminal commands

    Every week, I delete all the commands in .bash_history except the ones with complicated arguments that I use regularly. It saves scrolling through lots of trivial commands to find the complex one I really want.

Page 1 of 3 123 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •