Find a string only in a specific file inside subdirectories
Let’s say I need to find the function GetTypes() in all C# source file (.cs) the directories/subdirectories.
Let’s say I need to find the function GetTypes() in all C# source file (.cs) the directories/subdirectories.
How to filter out 2 lines for each line matching the grep regex?
this is my minimal test:
When I want to search a whole tree for some content, I use
I have to read log file between and my question is how to get only the text in the file wich is between two dates using unix commands?
Every line contain date and I want to get the text in the file which dates are equal or bigger that the FROM date and lower or equal than the TO date.
The format of the date is 13/05/23 01:58.
The second date is for an example 13/05/13 07:50.
Example
NOTE: This question is the complement of this Q&A: How to “grep” for line length in a given range?
When I execute ls /directory | grep '[^term]' in Bash I get a regular listing, as if the grep command is ignored somehow. I tried the same thing with egrep, I tried to use it with double and single quotes, but to no better results. When I try ls /directory | grep '^[term] I get all entries beginning with term – as expected.
In a huge UTF-8 text file, I want to show all lines that contains Japanese kanjis.
What grep (or other) expression does this?
My computer is running macOS 10.12.3 and I am using the system-installed grep utility with version 2.5.1-FreeBSD.
I use ubuntu 14.4, and been attempting to redirect the output of grep command to a file, but I keep getting this error:
I am extracting URLs from a website using cURL as below.