Unix cmd prompt how to get old cmd run?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Unix cmd prompt how to get old cmd run?
# 1  
Old 09-12-2010
Unix cmd prompt how to get old cmd run?

Hi,
I am using SunOS

I want to serch my previous command
from unix prompt

(like on AIX we can search by ESC -k)

how to get in SunOs

urgent help require.
# 2  
Old 09-13-2010
Quote:
Originally Posted by RahulJoshi
...
I want to serch my previous command
from unix prompt
...
how to get in SunOs
...
If you are on Bash or Ksh then you could use "history" command. "history n" lists the last n commands.

tyler_durden
# 3  
Old 09-13-2010
try
Code:
set -o vi

# 4  
Old 09-13-2010
I do not want to go through all history .
I want to get display cmd one by one and on my required one i will press enter key
or search previous cmd by pattern on prompt and when it display on prompt just enter and run .


please help me
# 5  
Old 09-13-2010
do you try set -o vi, then ESC-k ?
# 6  
Old 09-13-2010
when trying : set -o vi
getting error like-
: set: Syntax error
# 7  
Old 09-13-2010
Hi.

That's a csh error.

In csh you can recall the history of the last command using !!, and other commands using the history command or !10 for a specific command from the history.

Code:
% set history=200
% history
     4  set history=100
     5  history

% !5
history
     4  set history=100
     5  history
     6  history

% !!
history
     4  set history=100
     5  history
     6  history
     7  history

TTTT: csh and tcsh command history

Last edited by Scott; 09-13-2010 at 02:46 AM.. Reason: Added link
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

has no rc.local in /etc, how to auto run cmd in the boot process?

Hi I want to run some cmd before the linux boot up and I want to let it run before sshd service start, any helps? (1 Reply)
Discussion started by: yanglei_fage
1 Replies

2. Shell Programming and Scripting

Perl open(CMD, "cmd |"); buffering problem..

Hello, There's a third-party application's command that shows the application's status like "tail -f verybusy.log". When use the command, the output comes every 1-sec. but when it goes in a script below the output comes every 8-sec...What is the problem and how can I fix it? open(CMD,... (2 Replies)
Discussion started by: Shawn, Lee
2 Replies

3. Shell Programming and Scripting

run cmd based on input

Hi, This is what I have so far but it seems like a lot more than is necessary because....for example...user presses 2 or 3 ..... the script does the *same* thing it just depends on the directory it has to access....how can I improve this so that the code from 2 and 3 is only put once...? ... (4 Replies)
Discussion started by: holyearth
4 Replies

4. Shell Programming and Scripting

Use Unix shell script to open Windows command prompt (cmd)

Hello, I work on Windows and I use Putty to access a remote UNIX server. I am trying to build a shell script that will have as main task to open the Windows command prompt (cmd) and run some Windows commands thereafter. The commands are actually file transfer commands that will download a file... (14 Replies)
Discussion started by: rookie2785
14 Replies

5. Shell Programming and Scripting

how to change unix cmd display prompt?

I am new to to unix and I want to make my own basic shell. What is the code I can use to change the unix cmd console display? For example my unix display prompt says MyCompterName~, I want it to say WhatEverMan~ (3 Replies)
Discussion started by: megaearth77
3 Replies

6. Windows & DOS: Issues & Discussions

script to open new cmd prompt for devices on visio

Hello, Can any one please help: I have a lab design on Visio, with routers and switches. What I am planning to do is: when I double click a device icon - it should open a new cmd prompt window and automatically performs the telnet session and log's me into the device. Appreciate your... (0 Replies)
Discussion started by: sureshcisco
0 Replies

7. Shell Programming and Scripting

open terminal to run cmd using shell script

i want the shell script to open the terminal and in that terminal i want to run a command specified in the script... how can it be done... (2 Replies)
Discussion started by: chandrabhushan
2 Replies

8. Shell Programming and Scripting

Interaction shell cmd prompt

hi , how do i interact with the shell prompt. i need no. of args to be dynamic e.g $> type the no of args: <input from keyboard> Enter the 1 st arg : <input from keyboard> Enter the 2nd arg : <input from keyboard> ......... ......... let me know how to do it ... (1 Reply)
Discussion started by: adityamahi
1 Replies

9. UNIX for Dummies Questions & Answers

man <cmd> >> cmd.txt

I've noticed most of my postings here are because of syntax errors. So I want to begin compiling a large txt file that contains all the "man <cmd>" of the commands I most have problems with. I ran a "man nawk >> nawk.txt" but it included a header/footer on each "page". Anyone know how I'd be... (6 Replies)
Discussion started by: yongho
6 Replies

10. Shell Programming and Scripting

unix cmd

Hi i want a shell script to get the date which is mentioned in the first line of a file. file format is: #EOD rates on 20050228 at 22:06:37 -------- -------- ------- first line length is always fixed. (4 Replies)
Discussion started by: sasi
4 Replies
Login or Register to Ask a Question