LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Newbie
User Name
Password
Linux - Newbie This forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Thread Tools
Old 10-29-2008, 02:02 AM   #1
jsantosh_d
LQ Newbie
 
Registered: Oct 2008
Posts: 2
Blog Entries: 1
Thanked: 0
Smile Save history command in another file


[Log in to get rid of this advertisement]
Hi,
i am santosh!!
plz help me , how can i save the history command that were fired into another file ,

is this possible though scripting???

Regards
santo
jsantosh_d is offline     Reply With Quote
Old 10-29-2008, 02:05 AM   #2
klearview
Member
 
Registered: Aug 2006
Location: Edinburgh, Scotland
Distribution: Debian, Kubuntu
Posts: 302
Thanked: 2
Simple:

history > file

(where file is anything you want)
klearview is offline     Reply With Quote
Old 10-29-2008, 02:12 AM   #3
jsantosh_d
LQ Newbie
 
Registered: Oct 2008
Posts: 2
Blog Entries: 1
Thanked: 0

Original Poster
Smile History command

thanks for UR reply!!!


let me explain u

i want to save the history commands automatically in the desired file ,may be a script can be used !!!
also can we add the any entried in the crond ,for automation???

OR
is there any command to restrict the root not to clear the history file!!!

i.e " history -c"



regards
jsantosh_d is offline     Reply With Quote
Old 10-29-2008, 03:01 AM   #4
klearview
Member
 
Registered: Aug 2006
Location: Edinburgh, Scotland
Distribution: Debian, Kubuntu
Posts: 302
Thanked: 2
Add 'shopt -s histappend' to your bashrc to get history appended on bash session exit, make sure you have 'export HISTCONTROL=erasedups' there to have no duplicate entries and finally use a large number in 'export HISTSIZE=<large_number>' i.e. 25000.

This will give you a large .bash_history file that you can search and back-up as needed.
klearview is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to save bash history between reboots? Kropotkin *BSD 1 01-16-2007 04:28 PM
save history from konqueror steelheat Linux - Desktop 1 09-10-2006 10:11 AM
Where does KDE's run command save history? ljubak Linux - Desktop 1 08-28-2006 05:21 PM
gnome-terminal command history file?? kushalkoolwal Debian 1 03-07-2006 07:39 PM
zaurus (OZ 3.3.5) can konsole save comand history? Brain Drop Linux - Laptop and Netbook 1 04-02-2004 10:40 AM


All times are GMT -5. The time now is 05:55 PM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration