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
Solved

history feature ...

Posted on 2001-06-29
12
298 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
ID: 6238468
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
ID: 6242267
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
ID: 6246677
2 seems good, but how do I use it?
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 11

Expert Comment

by:griessh
ID: 6246961
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
ID: 6254705
I use the tcsh shell
0
 

Author Comment

by:mdoland
ID: 6254716
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
 
LVL 84

Expert Comment

by:ozo
ID: 6254730
 set history=25

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

Expert Comment

by:mrn060900
ID: 6288804
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
ID: 6302862
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
ID: 6825940
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
ID: 6878361
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
ID: 6878410
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

809 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