How can I output all previous Unix commands in Solaris to a file??


 
Thread Tools Search this Thread
Operating Systems Solaris How can I output all previous Unix commands in Solaris to a file??
# 1  
Old 02-21-2011
How can I output all previous Unix commands in Solaris to a file??

Hello friends:

I login to solaris with a username/Password and I can see quite a lot of previous I use dbefore, it accumulates a lot, I hope to output them into a Command.txt file as reference, not copy/paste 1 by 1, is there any way I can collect all commands in batch then put into a file,

Please advise


Thanks in advance
# 2  
Old 02-21-2011
If you're using BASH:
Code:
history > commandhistory.txt

If you're using standard shell:
Code:
cat ~/.sh_history* > commandhistory.txt

I think that should do it
# 3  
Old 02-22-2011
Great!! thanks so much!!

It really works!!
# 4  
Old 02-22-2011
Np Smilie

If you are using BASH, then another great tip to know is to use Ctrl-R, start typing and it will try and find a match in your history. Cycle through multiple 'finds' by using Ctrl-R again.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

AIX UNIX - script on how to extract from log file with previous date

Hello, I am new to this forum so any assistance would help. I am currently trying to develop a script that extract all data from a log file with has the previous day's date. $ <root@aixtest3> /var/log > more sudo.log May 13 10:52:10 aixtest3 local2:notice sudo: tbrath : TTY=unknown ; ... (14 Replies)
Discussion started by: Kslew82
14 Replies

2. Shell Programming and Scripting

Read from a file in unix(Continue from previous thread)

Hi This is continuation of previos thread status=running username=abc password=123456 server=linux The script was made which is used to capture the data from file ./scr test status It will give result running I have a case like status = running username=abc password=123456... (14 Replies)
Discussion started by: parthmittal2007
14 Replies

3. Shell Programming and Scripting

Reading UNIX commands from file and redirecting output to a file

Hi All I have written the following script: #!/bin/ksh while read cmdline do echo `$cmdline` pid="$cmdline" done<commands.txt =========== commands.txt contains: ps -ef | grep abc | grep xyz |awk '{print $2}; My objective is to store the o/p of the command in a variable and do... (8 Replies)
Discussion started by: rahulparo
8 Replies

4. Solaris

how to Implicitly execute some unix commands during/after Solaris reboot

I have to execute 2 commands everytime i reboot my Solaris machine. Simple "share" and "chown" commands. Is there anywhere (maybe a config file or something) where I can include these commands so that I do not have to manually run them everytime I reboot the machine? Any help appreciated... (2 Replies)
Discussion started by: lydiaEd
2 Replies

5. Solaris

previous commands using UPARROW key

What settings should be done in order make UPARROW key to show previous commands on the shell prompt(Solaris)? (6 Replies)
Discussion started by: shafi2all
6 Replies

6. Solaris

Sun solaris unix commands

hi friends, I am working in Sun solaris unix 10 with shell commands and all these works properly. Then i created a small function which includes these commands. Now the problem arises. When the commands are run by calling this fuction.it shows error. Why i am not able to run the unix... (1 Reply)
Discussion started by: gjithin
1 Replies

7. UNIX for Dummies Questions & Answers

Interpreting java output stream as system commands in Solaris

Hi there again, Running Solaris 10 with built-in Java. Seems to compile and run fine. Problem is: Say I want to see contents of current directory. In a shell, I'd just write "ls" and it outputs the content. When I write a Java file, I have the following line: System.out.println("ls"); ... (1 Reply)
Discussion started by: EugeneG
1 Replies

8. UNIX for Dummies Questions & Answers

Output of 2 commands into 1 file

How could you put the output of two commands into one file using a single command? For example put the output of a grep command and a sort command into one file together. Here is another rough explanation of what I am trying to do; output of $ grep pattern file1 plus output of $ sort file... (8 Replies)
Discussion started by: enuenu
8 Replies

9. UNIX for Dummies Questions & Answers

how do I get my arrow keys to work for looking thru my PREVIOUS UNIX COMMANDS

how do I make my arrow keys behave like they are on DOS. ALSO i need editing on command promt like it is on DOS on my UNIX prompt can anyone help pl.. (11 Replies)
Discussion started by: spotnis
11 Replies

10. UNIX for Dummies Questions & Answers

Can I use history command to run previous commands?

Hi, I can use history command in unix to view my last 50 commands. But how can I run the previous commands easily? Can history command help? Firebird (2 Replies)
Discussion started by: firebirdonfire
2 Replies
Login or Register to Ask a Question