Terminal : How to list previous commands?
Folks,
In a Terminal : How to list previous commands? More importantly, is it possible to put them in a file? |
to view previous commands:
$ history to create a file: $ history >> filename edit: of course, it already exists in a file - .bash_history cheers, |
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 |
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.
|
Thanks folks. It works. :)
|
Re: previous commands
Hi friends,
A am using RHEL5.4 and in my server I logined as a root user and i have done some tasks like creating files, directories deleting directories and before logout as root i entered a command "history -c". Then what is the procedure to view also those previous commands. I used a command "lastcomm", but it is not ginving the complete information. Friends is there any command to view my previous commands |
Apart from reading the dead thread you just resurrected, you could also check the man page, because there's no such argument for the history command.
Code:
man history |
All times are GMT -5. The time now is 04:42 AM. |