Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

commands

Posted on 2014-02-24
14
Medium Priority
?
196 Views
Last Modified: 2014-12-06
SYS@spserv>

How will see the previously used command in a console in sunsolaris box?
0
Comment
Question by:thomasliju
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +3
14 Comments
 
LVL 35

Expert Comment

by:johnsone
ID: 39883985
I don't see what this is doing in the Oracle zone.

If it is set up correctly, then the history command should give you some number of previous commands.
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 39884003
Since it's Solaris I assume that your shell is ksh.

Issue

set -o emacs

and hit <Ctrl><P>

(press and hold the <Ctrl> key, then hit the letter "p".)

to see the previous command.

Hit that key combinaton several times to scroll up in the command history.

Add "st -o emacs" to ~/.profile to make this option permanent.
0
 
LVL 9

Expert Comment

by:Lee Ingalls
ID: 39884009
If you're looking for shell command logging...
Set theses variables into local environnement file.

For csh shell (.cshrc)
set history=100
set savehist=100

100 is the max of the command that will be logged

To see the history type history command at the user prompt and the history is also logged in ~/.history file after the user logs out the session.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:thomasliju
ID: 39884029
Slightv
I mean oracle sql commands in sunsolaris machine...
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 672 total points
ID: 39884037
For sqlplus try "/" (slash) followed by <ENTER> to repeat the last command.

"l" <ENTER> (the letter "l" followed by the ENTER key) will show the last command.

"edit" or "ed" opens the last command for editing. Save the changed command with <ESC>:wq! <ENTER>
then type / and hit <Enter> to execute it.
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39884162
I believe sqlplus in Unix follows the OS settings.

If none of the previous suggestions work, try the 'standard' up arrow key.

I none of this works, I would suggest you spend a little time in the online SQLPlus documentation?
0
 
LVL 23

Assisted Solution

by:Steve Wales
Steve Wales earned 664 total points
ID: 39884168
It does not appear to be built in to sqlplus in Unix.

However I did find reference in a couple of blog posts to a utility called rlwrap that worked on Linux (no idea if it will work on Solaris):

Try it out, let us know if it works :)   (although probably not in a production environment!)

The two links below talk about rlwrap, and how to configure and use it.

http://sysdba.wordpress.com/2006/10/08/how-to-use-rlwrap-to-get-a-command-history-in-sqlplus/
http://www.adp-gmbh.ch/ora/sqlplus/index.html

I did follow the link and the utility does still seem to be available (since the original blog post was from 2006).
0
 
LVL 35

Assisted Solution

by:johnsone
johnsone earned 664 total points
ID: 39885276
SQL*Plus on the Unix side doesn't do command history.  You only have access to the last command as mentioned.
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39885532
>>SQL*Plus on the Unix side doesn't do command history

You mean the DOS version does something Unix doesn't?  WOW.
0
 
LVL 35

Expert Comment

by:johnsone
ID: 39885544
Yes, kind of amazing isn't it.  It has always been that way.  No idea why they never had that feature on the UNIX version.
0

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Via a live example, show how to take different types of Oracle backups using RMAN.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question