FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 02-28-2012, 03:54 PM
Wayne Topa
 
Default history configuration

On 02/28/2012 11:19 AM, lina wrote:

Hi,

How to configure to make each terminal shared one "history"

I found each terminal saves its own history and no sharing.

Is it possible to let them share?



man bash

/bash_history gets you some info

n Gets you the next occurrence , etc

A lot of your questions can be answered by using you system
first.

WT


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4F4D06B9.9000300@gmail.com">http://lists.debian.org/4F4D06B9.9000300@gmail.com
 
Old 02-28-2012, 04:01 PM
Wayne Topa
 
Default history configuration

On 02/28/2012 11:19 AM, lina wrote:

Hi,

How to configure to make each terminal shared one "history"


Each terminal of different users or the same user?


I found each terminal saves its own history and no sharing.


Why would you want share your command history with another user?



Is it possible to let them share?

Thanks ahead,

Best Regards,





--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4F4D0878.2010107@gmail.com">http://lists.debian.org/4F4D0878.2010107@gmail.com
 
Old 02-28-2012, 04:06 PM
lina
 
Default history configuration

On Wed, Feb 29, 2012 at 1:01 AM, Wayne Topa <linuxtwo@gmail.com> wrote:
> On 02/28/2012 11:19 AM, lina wrote:
>>
>> Hi,
>>
>> How to configure to make each terminal shared one "history"
>
>
> Each terminal of different users or the same user?

The same.

I am the only user on laptop.

Here I mean terminal, refer to several terminals I opened.
>
>
>> I found each terminal saves its own history and no sharing.
>
>
> Why would you want share your command history with another user?
>
>
>>
>> Is it possible to let them share?
>>
>> Thanks ahead,
>>
>> Best Regards,
>>
>>
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject
> of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: http://lists.debian.org/4F4D0878.2010107@gmail.com
>


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAG9cJmmTajKZUTrUALDFfWuuCV9AJmkfkiBdhmEi0SSaNw8MM g@mail.gmail.com">http://lists.debian.org/CAG9cJmmTajKZUTrUALDFfWuuCV9AJmkfkiBdhmEi0SSaNw8MM g@mail.gmail.com
 
Old 02-28-2012, 04:09 PM
lina
 
Default history configuration

On Wed, Feb 29, 2012 at 12:54 AM, Wayne Topa <linuxtwo@gmail.com> wrote:
> On 02/28/2012 11:19 AM, lina wrote:
>>
>> Hi,
>>
>> How to configure to make each terminal shared one "history"
>>
>> I found each terminal saves its own history and no sharing.
>>
>> Is it possible to let them share?
>>
>
> man bash

Thank you here. I didn't know it's inside the bash.
>
> /bash_history *gets you some info
>
> n * Gets you the next occurrence , etc
>
> A lot of your questions can be answered by using you system
> first.

(Sorry about that)

Best regards,
>
> WT
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject
> of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: http://lists.debian.org/4F4D06B9.9000300@gmail.com
>


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAG9cJmmLc3fuJq9_N1boenRoi5Y0ohKFuyyLG1H26A-s2ts1bQ@mail.gmail.com">http://lists.debian.org/CAG9cJmmLc3fuJq9_N1boenRoi5Y0ohKFuyyLG1H26A-s2ts1bQ@mail.gmail.com
 
Old 02-28-2012, 04:29 PM
Camaleón
 
Default history configuration

On Wed, 29 Feb 2012 00:19:19 +0800, lina wrote:

> How to configure to make each terminal shared one "history"
>
> I found each terminal saves its own history and no sharing.
>
> Is it possible to let them share?

Have you Googled for that? ;-)

http://www.google.com/webhp?complete=0&hl=en#hl=en&complete=0&site=webhp &q=linux+history+share+between+terminals&pbx=1&bav =on.2,or.r_gc.r_pw.,cf.osb&fp=afa599453b32a79f&biw =1280&bih=888

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jij2su$4vb$14@dough.gmane.org">http://lists.debian.org/jij2su$4vb$14@dough.gmane.org
 
Old 02-28-2012, 05:13 PM
Wayne Topa
 
Default history configuration

On 02/28/2012 12:06 PM, lina wrote:

On Wed, Feb 29, 2012 at 1:01 AM, Wayne Topa<linuxtwo@gmail.com> wrote:

On 02/28/2012 11:19 AM, lina wrote:


Hi,

How to configure to make each terminal shared one "history"



Each terminal of different users or the same user?


The same.

I am the only user on laptop.

Here I mean terminal, refer to several terminals I opened.


Terminals, like F2 F3 F4, etc? If so then I include this from the
debian-reference package, which I hope you have installed as it is the
Debian Bible and should be read be every new Debian user.




1.1.6. Virtual consoles

In the default Debian system, there are six switchable VT100-like
character consoles available to start the command shell directly on the
Linux host. Unless you are in a GUI environment, you can switch between
the virtual consoles by pressing the Left-Alt-key and one of the F1 — F6
keys simultaneously. Each character console allows independent login to
the account and offers the multiuser environment. This multiuser
environment is a great Unix feature, and very addictive.


If you are under the X Window System, you gain access to the character
console 1 by pressing Ctrl-Alt-F1 key, i.e., the left-Ctrl-key, the
left-Alt-key, and the F1-key are pressed together. You can get back to
the X Window System, normally running on the virtual console 7, by
pressing Alt-F7.


You can alternatively change to another virtual console, e.g. to the
console 1, from the commandline.


and

.4.3. Special key strokes

In the Unix-like environment, there are few key strokes which have
special meanings. Please note that on a normal Linux character console,
only the left-hand Ctrl and Alt keys work as expected. Here are few
notable key strokes to remember.


Table 1.14. List of key bindings for bash
key description of key binding
Ctrl-U erase line before cursor
Ctrl-H erase a character before cursor
Ctrl-D terminate input (exit shell if you are using shell)
Ctrl-C terminate a running program
Ctrl-Z temporarily stop program by moving it to the background job
Ctrl-S halt output to screen
Ctrl-Q reactivate output to screen
Ctrl-Alt-Del reboot/halt the system, see inittab(5)
Left-Alt-key (optionally, Windows-key) meta-key for Emacs and the
similar UI

-----
Up-arrow start command history search under bash
^^^^^^^^^^ < this might help you lina
-----
Ctrl-R start incremental command history search under bash
Tab complete input of the filename to the command line under bash
Ctrl-V Tab input Tab without expansion to the command line under bash

Wayne


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4F4D1945.9010908@gmail.com">http://lists.debian.org/4F4D1945.9010908@gmail.com
 
Old 02-28-2012, 06:22 PM
Shawn Wilson
 
Default history configuration

"Camaleón" <noelamac@gmail.com> wrote:

>On Wed, 29 Feb 2012 00:19:19 +0800, lina wrote:
>
>> How to configure to make each terminal shared one "history"
>>
>> I found each terminal saves its own history and no sharing.
>>
>> Is it possible to let them share?
>
>Have you Googled for that? ;-)
>
>http://www.google.com/webhp?complete=0&hl=en#hl=en&complete=0&site=webhp &q=linux+history+share+between+terminals&pbx=1&bav =on.2,or.r_gc.r_pw.,cf.osb&fp=afa599453b32a79f&biw =1280&bih=888
>

Not bad google results. I've actually been searching for a way to save screen sessions between reboots. While this isn't the solution, I think I can go with this and write file.pty and pop each file into my history as I spawn new screen sessions. I might even figure out how to do similar with variables if I can figure this out.

The other solution to my problem might be kvm instances.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 19fb0599-f3ce-4bbe-9b99-bd47da0b5df4@email.android.com">http://lists.debian.org/19fb0599-f3ce-4bbe-9b99-bd47da0b5df4@email.android.com
 
Old 02-28-2012, 08:08 PM
Wayne Topa
 
Default history configuration

On 02/28/2012 12:06 PM, lina wrote:

On Wed, Feb 29, 2012 at 1:01 AM, Wayne Topa<linuxtwo@gmail.com> wrote:

On 02/28/2012 11:19 AM, lina wrote:


Hi,

How to configure to make each terminal shared one "history"



Each terminal of different users or the same user?


The same.

I am the only user on laptop.

Here I mean terminal, refer to several terminals I opened.


If you want a separate .bash_history files for each console
you use then I suggest you use adduser to create users lina0, lina1,
& lina3. Then, if you use 4 consoles you can login 4 users each having
their own bash history.


What ever floats your boat.Wayne


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4F4D4258.2050802@gmail.com">http://lists.debian.org/4F4D4258.2050802@gmail.com
 
Old 02-29-2012, 01:41 AM
lina
 
Default history configuration

On Wed, Feb 29, 2012 at 1:29 AM, Camaleón <noelamac@gmail.com> wrote:
> On Wed, 29 Feb 2012 00:19:19 +0800, lina wrote:
>
>> How to configure to make each terminal shared one "history"
>>
>> I found each terminal saves its own history and no sharing.
>>
>> Is it possible to let them share?
>
> Have you Googled for that? ;-)
>
> http://www.google.com/webhp?complete=0&hl=en#hl=en&complete=0&site=webhp &q=linux+history+share+between+terminals&pbx=1&bav =on.2,or.r_gc.r_pw.,cf.osb&fp=afa599453b32a79f&biw =1280&bih=888


I checked my .bashrc

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1048576
HISTFILESIZE=1048576
set histappend=true
LAST_HISTORY_WRITE=$SECONDS
function prompt_command {
if [ $(($SECONDS - $LAST_HISTORY_WRITE)) -gt 300 ]; then
history -a
LAST_HISTORY_WRITE=$SECONDS
fi
}
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

seems it needs to tweak. I guess it's long long time ago I copied
that. can's remember.
>
> Greetings,
>
> --
> Camaleón
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: http://lists.debian.org/jij2su$4vb$14@dough.gmane.org
>


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAG9cJmmuKPRdoM0-_jmMgkM7vfONwY0TKOqA6W2qCZT0wyTjhg@mail.gmail.com" >http://lists.debian.org/CAG9cJmmuKPRdoM0-_jmMgkM7vfONwY0TKOqA6W2qCZT0wyTjhg@mail.gmail.com
 
Old 03-08-2012, 03:01 AM
 
Default history configuration

>> On Wed, 29 Feb 2012 00:19:19 +0800, lina <lina.lastname@gmail.com> said:

L> How to configure to make each terminal share one "history"? I found
L> each terminal saves its own history and no sharing. Is it possible to
L> let them share?

You can if you don't mind stretching the definition of "share". Have a
look at this page to see how to save your command history to syslog:
http://jablonskis.org/2011/howto-log-bash-history-to-syslog/

Here's an example. I added this to the end of ~/.bashrc to save history
to my own file and the system log:

export PROMPT_COMMAND='history -a >(tee -a ~/.bash_history |
logger -p local2.notice -t "$USER [$$] $SSH_CONNECTION")'

This sends my history to facility "local2" with priority "notice".
I fixed syslog so local[25] messages only show up in one place; I already
use local5 for output from a backup program. Here's the relevant part
of /etc/syslog.conf -- backslashes must be at the end of the lines:

# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;kern.none;mail.none;
authpriv.none;auth.none;local2.none;
local5.none;cron.none /var/log/messages
# Auth logfiles are restricted.
authpriv.* /var/log/secure
auth.* /var/log/authlog
# Local logs.
local0.* /var/log/local0log
local1.* /var/log/local1log
local2.* /var/log/local2log
local3.* /var/log/local3log
local4.* /var/log/local4log
local5.* /var/log/local5log
local6.* /var/log/local6log
# Cron stuff
cron.* /var/log/cron

Here's what my history looks like:

me% tail -3 /var/log/local2log
Mar 7 22:09:22 svr1 vogelke [149] 1.2.3.4 46555 5.6.7.8 22: which logger
Mar 7 22:09:31 svr1 vogelke [149] 1.2.3.4 46555 5.6.7.8 22: echo $PATH
Mar 7 22:09:44 svr1 vogelke [149] 1.2.3.4 46555 5.6.7.8 22: dir /var/log/local*

me% tail -3 $HOME/.bash_history
which logger
echo $PATH
dir /var/log/local*

"1.2.3.4" is where I'm connecting from, "5.6.7.8" (aka "svr1") is the
host I'm connecting to via SSH. If you use the Z-shell instead of bash,
the method is pretty similar -- add this function to the bottom of your
~/.zshrc file:

# Log commands, return codes and the current working directory.
# Based on:
#
# http://blogs.sun.com/chrisg/entry/logging_commands_in_korn_shell
# Logging commands in korn shell
# Chris Gerhard
# Thu, 2 Mar 2006 09:47:29 -0500
#
# Don't try to put local on the x= line. If you do,
# any command arguments (i.e., "ls -la") will throw an error:
# precmd:local:2: not an identifier: -la
precmd () {
typeset -i stat=$?
local x
x=$(fc -ln -1)
local d="$(/bin/pwd)"
logger -p local2.notice -t "$LOGNAME $$" $stat: $d: ($x)
}

In order to really share this, you'd probably have to write something to
grub around in the syslog file.

--
Karl Vogel I don't speak for the USAF or my company

She acts like she's on the phone to avoid certain customers. One time it rang.
--Jimmy Fallon, #mycoworkeriscrazy tweets, 2 Mar 2012


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120308040126.7EC1CBFBA@kev.msw.wpafb.af.mil">htt p://lists.debian.org/20120308040126.7EC1CBFBA@kev.msw.wpafb.af.mil
 

Thread Tools




All times are GMT. The time now is 07:01 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org