From owner-freebsd-questions@FreeBSD.ORG Fri Jan 5 08:02:24 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A813B16A583 for ; Fri, 5 Jan 2007 08:02:24 +0000 (UTC) (envelope-from cptsalek@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.230]) by mx1.freebsd.org (Postfix) with ESMTP id 5896913C46A for ; Fri, 5 Jan 2007 08:02:24 +0000 (UTC) (envelope-from cptsalek@gmail.com) Received: by wx-out-0506.google.com with SMTP id s18so6516698wxc for ; Fri, 05 Jan 2007 00:02:23 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=nNE68dThUJxR4WUBYJW1EyKhFi4sA99O1IHB9+PRbYdGmYKrmnu1MCTDk05BonR04iNHrGdPB/Lg7Jrl8XM04ei/kWft/cuOncEcwfgbliMg2yg5yfoVoYdZ6z+feBzDR71tYb32NAXxY0gG5I1X6sVaM3PIjluaxY0IpC6K7Js= Received: by 10.70.80.14 with SMTP id d14mr42677379wxb.1167984143933; Fri, 05 Jan 2007 00:02:23 -0800 (PST) Received: by 10.70.14.15 with HTTP; Fri, 5 Jan 2007 00:02:23 -0800 (PST) Message-ID: <14989d6e0701050002l56eb3867n2f58de67201e5064@mail.gmail.com> Date: Fri, 5 Jan 2007 09:02:23 +0100 From: "Christian Walther" To: Vizion In-Reply-To: <20070104163203.JLAW60.dukecmmtao03.coxmail.com@dukecmmtao03> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070104163203.JLAW60.dukecmmtao03.coxmail.com@dukecmmtao03> Cc: freebsd-questions@freebsd.org Subject: Re: Clutz-Proof Logging X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jan 2007 08:02:24 -0000 I'll try to follow up to two posts instead of replying twice, so I hope nobody gets confused here. :-) On 04/01/07, Vizion wrote: > ----- Original Message ---- > From: Bill Moran > > >Many shells keep a history as a matter of normal operation. You might > >find that enough for you. Personally, I use bash, and the command > >"history" brings the last 100 commands or so. > > No, this isn't sufficient. The problems are: > 1) occasionally the sysadmin people at the server farm do stuff > 2) sometimes I edit files, and of course the shell doesn't record how > 3) the shell history seems erratic! It remembers the session clearly, but if I reboot, for example, and look at the history, it's not what I would > expect it to be. The history function of many modern shell is configurable. The number of commands being saved can be changed, as well as the behaviour regarding different ttys (so you might have different histories for different ttys you're coming from). The history function uses a file, so you rely on this file being written to disk. In case you reboot the machine it's possible that the history of the current session is lost. Take a look at the "script" command. It saves a typescript of everything being typed during a terminal session. So you've got your own copy without the need of a working and reliable history. And as Richard Lynch suggests it, using a versioning system like CVS or SVN might be a good idea. Or, as a simpler aproach: Just create a backup of a file before you touch it, for example by copying it to someplace else, and/or by adding a timestamp. > I am not certain if you are using X or console. > > On X windows you can set the size of the history to your liking - I usually set to unlimited. Then, as frequently as one wishes, save the session to a log file. I have not found any problem with history not being the "history". Are you talking about X windows or KDE or GNOME? Normally, any x based terminal executes a shell, so the history is still controlled by the shell being used. If you're using Konsole or gnome-terminal, it's possible that you can configure the history somewhere in the terminals gui, but in this case the terminal sends the apropriate commands to configure the history.