LinuxQuestions.org
Social Bookmarking all things Linux and Open Source
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

Tags used in this thread
Popular LQ Tags ,

Reply
 
Thread Tools
Old 03-08-2008, 04:07 PM   #1
concoran
Member
 
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 467
Thanked: 0
Terminal : How to list previous commands?


[Log in to get rid of this advertisement]
Folks,

In a Terminal : How to list previous commands? More importantly, is it possible to put them in a file?
concoran is offline  
Tag This Post ,
Reply With Quote
Old 03-08-2008, 04:21 PM   #2
mrclisdue
Member
 
Registered: Dec 2005
Distribution: Slackware -current, 13.0, 12.2, 12.1
Posts: 622
Thanked: 35
to view previous commands:

$ history

to create a file:

$ history >> filename


edit: of course, it already exists in a file - .bash_history


cheers,

Last edited by mrclisdue; 03-08-2008 at 04:23 PM..
mrclisdue is offline     Reply With Quote
Old 03-08-2008, 04:23 PM   #3
vaalu
Member
 
Registered: Jun 2007
Posts: 52
Thanked: 0
it is simple..
type "history" to list the previous commands..
history > output
typing that in the terminal will save the output to a file
also the script command is a useful one to record the terminal activities

type script in the terminal the moment from which you want the activities recorde.then when you are done just type exit.and you will find a file named typesdript in the home directory..that will do
vaalu is offline     Reply With Quote
Old 03-08-2008, 05:05 PM   #4
Emerson
Senior Member
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~
Posts: 2,632
Thanked: 2
To re-use previous commands type a few letters from beginning and tap Page-Up. Depending how long is your history - usually 1000 lines - it makes life real easy.
Emerson is offline     Reply With Quote
Old 03-08-2008, 05:41 PM   #5
concoran
Member
 
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 467
Thanked: 0

Original Poster
Thanks folks. It works.
concoran 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
making a script that opens terminal and enter commands into that terminal Cinematography Linux - General 8 12-16-2008 11:34 AM
In Solaris(command Line ), How to get the previous commands? kcarun Solaris / OpenSolaris 20 08-05-2007 10:00 AM
Clear previous commands in Terminal Hitboxx Fedora 4 07-12-2006 08:20 AM
going through previous bash commands corrupts console text? juanbobo Linux - Software 1 08-30-2005 11:24 AM
Can ash recall previous commands? Scerj Linux - General 0 06-06-2001 03:18 PM


All times are GMT -5. The time now is 03:04 AM.

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