Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

grep exit

hi,

I am trying to grep below

grep "SendLoginEvent" crm-CRMJava7-Staging-crm_st5_1.log.20171013*

but when i typed below i pasted something here like xyzzzzz

grep "SendLoginEvent xyzzzzz
xyzzzzz
xyzzzzz
xyzzzzz


>
>
>




now i cannot exit from this grep
i tried control Z not use
i tried esc no use

how to exit out

please advise
Avatar of gudii9
gudii9
Flag of United States of America image

ASKER

looks like control D worked
ASKER CERTIFIED SOLUTION
Avatar of Sudeep Sharma
Sudeep Sharma
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

ASKER

When you typed grep "SendLoginEvent xyzzzzz

did you forgot to close the command by typing the " at the end of the command?

yes

what other short cuts i should familiarize?

lile control D and control C

what is difference between contol c and control d (is it capitol or small letter so much difference again with cases)

any good link describing all these commands
please advise
Avatar of gudii9

ASKER

when q and :q quite
in more command and vi editor

unix language has different comands to quit for different operations?
Install nano, emacs, these editors have controls on the screen.
In vi, escape
:?
In vi provides the answer.to which options and what they do.

There are guides, quick references to editors. It is impossible to answer.
is just a letter, as are :q
Vi sequence is escape to exit into exec mode where commands can be issued.
I suggest you take a class.  You've been asking a lot of questions here that can be more easily covered in a class and a lab where you can get hands on training.  The questions you ask here take longer to have response.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

ASKER

ctrl-D is end of file,,ctrl-C terminate.
Install nano, emacs, these editors have controls on the screen.

Its an syntax issue, once you opened " or ' you have to make sure that you have closed it.

grep "SendLoginEvent" crm-CRMJava7-Staging-crm_st5_1.log.20171013*

but when i typed below i pasted something here like xyzzzzz

grep "SendLoginEvent xyzzzzz
xyzzzzz
what do we mean by end of the file(does it mean end of the file name in the grep command?
how end of file different from terminate when should we each terminate when should we use end of file
search terms need double quotes right not the file names?
when we use single quotes instead f double quotes?
end of file, means there is no further input.
You have to provide context to your question. The way to indicate an end to input depends on what the mechanism that takes in the input.
You are mixing and combining different aspects into a single question that makes it extremely confusing on what it is you want an answer to.

enclosing in double quotes means that the shell will interpret the contects within if there is a variable. using a single set of quotes means the data within is literal.
somevalue='pattern'
The above in a shell is defining a variable named somevalue. To see the contents of the variable you prepend it with a $somevalue
echo "$somevalue"
will output pattern
echo '$somevalue'
will output the text $somevalue

the same is true for grep "$somevalue" versus grep '$somevalue' from any source

If you open a quote the input handler on the shell will wait until you enter a closing matching the opening in your case it is waiting for "
control-D will indicate end of input, and you will get an error because of the mismatch of the ".
control-C will terminate the echo command.