[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 315
  • Last Modified:

history feature ...

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
mdoland
Asked:
mdoland
  • 3
  • 3
  • 2
  • +4
1 Solution
 
griesshCommented:
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
 
TalmashCommented:
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
 
mdolandAuthor Commented:
2 seems good, but how do I use it?
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
griesshCommented:
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
 
mdolandAuthor Commented:
I use the tcsh shell
0
 
mdolandAuthor Commented:
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
 
ozoCommented:
 set history=25

tells tcsh to save the last 25 commands on the history list
0
 
mrn060900Commented:
try set -o vi, then use esc k to scroll through the history

esc j goes backwards through the history.

Regards Mike
0
 
biraCommented:
After entering    set -o vi ,

                   ESC + k
                   /string

          where string is part of the command name you
          want to find in history.
0
 
MoondancerCommented:
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
 
MoondancerCommented:
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
 
griesshCommented:
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

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 3
  • 3
  • 2
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now