Solved

history feature ...

Posted on 2001-06-29
12
283 Views
Last Modified: 2010-04-21
Hi

I was working with a Unix system some years ago where it was possible to write for instance:
computer> !f

Tha would result in the system doing the first command that matched in history that started with f.

Does anyone know how I can gt that featureworking in  my environment?
0
Comment
Question by:mdoland
  • 3
  • 3
  • 2
  • +4
12 Comments
 
LVL 11

Accepted Solution

by:
griessh earned 40 total points
Comment Utility
That depends on the shell you are using.

We just had that discussion 3 or 4 questions down in this area, so please check http://www.experts-exchange.com/jsp/qShow.jsp?ta=unix&qid=20142786 for more info about how to history in ksh

BTW: csh is using "!#" for history rerun. You will get a list of commands with "history"

======
Werner
0
 
LVL 6

Expert Comment

by:Talmash
Comment Utility
hi .

2 suggestions :

1 :

history | grep 'f'

simple but not so good .

2 :

write f
then esc + p ,
each esc + p while search history backward to look for last
command started with f .

Tal
0
 

Author Comment

by:mdoland
Comment Utility
2 seems good, but how do I use it?
0
 
LVL 11

Expert Comment

by:griessh
Comment Utility
Hm, the grep seems a bit rough. What is your login shell? As I said, the "!" command reruns commands. You can always run "history" that will give you a list of commands with numbers. Then
!5 will rerun command number 5

If you want to do it a bit more comfortable, there are versions that allow to do something like

r li

which will rerun the lastest command starting with "li", but you really have to tell us more about your environment.

Talmash

By locking this question it is out of the pool of Open Questions. We usually post a solution only as an answer if it is 150% clear that this is the solution. You should take a look at the tips at the end of the page. I would suggest to mdoland to reject the answer to get it back in the loop. But that's up to him now.

======
Werner
0
 

Author Comment

by:mdoland
Comment Utility
I use the tcsh shell
0
 

Author Comment

by:mdoland
Comment Utility
I haven't worked that much wih unix and would therefore like to have it explained what I shall put where to get it working, and as I just mentioned, I use tcsh as my shell.
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 84

Expert Comment

by:ozo
Comment Utility
 set history=25

tells tcsh to save the last 25 commands on the history list
0
 
LVL 3

Expert Comment

by:mrn060900
Comment Utility
try set -o vi, then use esc k to scroll through the history

esc j goes backwards through the history.

Regards Mike
0
 
LVL 6

Expert Comment

by:bira
Comment Utility
After entering    set -o vi ,

                   ESC + k
                   /string

          where string is part of the command name you
          want to find in history.
0
 
LVL 1

Expert Comment

by:Moondancer
Comment Utility
This question appears to have been abandoned. Your options are:
 
1.  Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3.  Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4.  Delete the question. Again, you must tell the other participants why you wish to do this.
 
Please click this Help Desk link for Member Guidelines, Member Agreement and the Question/Answer process:  Click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues.
http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp
 
PLEASE DO NOT AWARD THE POINTS TO ME.  
 
------------>  EXPERTS:
 
Please leave any comments regarding this question here on closing recommendations if this item remains inactive another three days.
 
Thank you everyone.
 
Moondancer
Moderator @ Experts Exchange
0
 
LVL 1

Expert Comment

by:Moondancer
Comment Utility
SECOND REQUEST!

ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101 or Netminder will return to finalize these if still open in seven days.  Please post closing recommendations before that time.

Question(s) below appears to have been abandoned. Your options are:
 
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question. Again, please comment to advise the other participants why you wish to do this.

For special handling needs, please post a zero point question in the link below and include the question QID/link(s) that it regards.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click the Help Desk link on the left for Member Guidelines, Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Please click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues, to track all your open and locked questions at this site.  If you are an EE Pro user, use the Power Search option to find them.  Anytime you have questions which are LOCKED with a Proposed Answer but does not serve your needs, please reject it and add comments as to why.  In addition, when you do grade the question, if the grade is less than an A, please add a comment as to why.  This helps all involved, as well as future persons who may access this item in the future to seek help.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.20033707.html
http://www.experts-exchange.com/questions/Q.20143410.html
http://www.experts-exchange.com/questions/Q.20172097.html
http://www.experts-exchange.com/questions/Q.20186162.html
http://www.experts-exchange.com/questions/Q.20187670.html
http://www.experts-exchange.com/questions/Q.20243438.html
http://www.experts-exchange.com/questions/Q.20231011.html
http://www.experts-exchange.com/questions/Q.20099226.html
http://www.experts-exchange.com/questions/Q.11919278.html
http://www.experts-exchange.com/questions/Q.20276510.html


To view your locked questions, please click the following link(s) and evaluate the proposed answer.
http://www.experts-exchange.com/questions/Q.11697498.html
http://www.experts-exchange.com/questions/Q.20120401.html

PLEASE DO NOT AWARD THE POINTS TO ME.  
 
------------>  EXPERTS:  Please leave any comments regarding your closing recommendations if this item remains inactive another seven (7) days.  Also, if you are interested in the cleanup effort, please click this link http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643

Moderators will finalize this question if still open in 7 days, by either moving this to the PAQ (Previously Asked Questions) at zero points, deleting it or awarding expert(s) when recommendations are made, or an independent determination can be made.  Expert input is always appreciated to determine the fair outcome.
 
Thank you everyone.
 
Moondancer
Moderator @ Experts Exchange

P.S.  For any year 2000 questions, special attention is needed to ensure the first correct response is awarded, since they are not in the comment date order, but rather in Member ID order.
0
 
LVL 11

Expert Comment

by:griessh
Comment Utility
I suggest to mrn's comment as an answer. I am not 150% sure about tcsh, but it the settings should work without any problems.

======
Werner
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now