I would like to search all .java files which have the newline escape sequence \n (backslash followed by 'n') in the files.
I am using this command:
find . –name "*.java" –print | xargs grep “\n”
but the result shows all lines in .java files having the letter n.
I want to search for a newline \n.
Can you please suggest a solution?
Example:
x.java
method abc{
String msg="\n Action not allowed.";}
y. java
method getMsg(){
String errMsg = "\n get is not allowed.";}
I want to search all *.java files having these type of strings defined with newline escape sequence.
\nis newline;\ris carriage return. What are you after?.classfile or object file), lines are interpreted as a sequence of characters up to the next newline character (even if there are millions of characters in total, including zero or null bytes).