grep a Unix command-line utility which searches input passed to it for lines matching a regular expression, and prints the results.

learn more… | top users | synonyms

0
votes
4answers
82 views

Check which string occurs first in a growing file

I'm running a remote executable which produces a logfile. I want to write a script to check whether the executable is run successfully or encounters an error. The way I can do this is by looking at ...
0
votes
3answers
113 views

Grep for block surrounding an error message

I want to grep for the block of logs around a particular error message. Say I know my log looks like this: [----] I, [2014-04-10T19:12:36.294512 #1910:e93004] INFO -- : Started GET "/ems_infra/new" ...
0
votes
3answers
632 views

Bash - Move those files that contain the string to directory

Task: Create script, that will take 2 arguments: 3.sh <directory> <destination> Search the files in <directory> for substring “moveme” in the file content Move those files that ...
1
vote
2answers
49 views

How to find files which do not contain their own filename

When using templates to generating files, it's important to include the template's name inside the template. When reading a generated file, it helps you find the template used to generate it. I want ...
1
vote
2answers
214 views

Extract URLS from code statements in JS files

All, I want to extract all URLS mentioned in code statements in all js files in a folder. For e.g. if a js file contains this piece of code: var myURL="http://yahoo.com/signup" //var ...
1
vote
2answers
1k views

Remove all except one file and directory at path

I need to remove all the files in a directory except for one file and one folder. Up to the grep I can output the correct list of items I want to remove but when i add xags, nothing is deleted. this ...
0
votes
2answers
56 views

Use grep to find files and pipe/open to open them

How can I pipe files from grep to open all matching files? I've tried grep -li "type" * | open, but that does not work.
0
votes
2answers
52 views

grep out condition and add the values of the grep value

I have a scenario that a csv file has the values of : abcd FAILURE 7 abcd SUCCESS 12 efgh SUCCESS 3 efgh FAILURE 5 mnop SUCCESS 6 mnop SUCCESS 4 abcd FAILURE 5 efgh SUCCESS 2 mnop SUCCESS 1 ...
0
votes
2answers
29 views

UWIN grep on windows, wildards failure

I have the UWIN unix tools, and I can't grep a whole dir full of files with *. grep term * gives grep: *: can not open [No such file or directory] whether in cmd.exe or powershell (I hate this ...
0
votes
2answers
389 views

Send HTTP request from server to another server and get the IP that replies

so I have to do this project, and I honestly have NO idea where to start. So basically, it will send a simple GET request to a web server, and then wait for a reply, and it will print out the IP that ...
0
votes
2answers
33 views

Bash: accessing another users documents

Using bash scripting I am trying to access another's users documents and search for a word in a file, how would I do this?
0
votes
2answers
219 views

Trying to Grep Multiple Phone Numbers Around a Specific Time

I work in at a telecom company and in some cases I need to search for multiple numbers around a specific time. I am using Ubuntu sever 10.04. When I search for a call my normal expression is: grep ...
0
votes
2answers
110 views

Generate a files list and truncate it in 2 list of X Mb of files each

I need to generate a list of all files in a certain dir, and truncate it in X lists containing each one a fixed amount of data of files. E.g. I have 95 Gb of data. generate the file list ...
-2
votes
2answers
90 views

Trying to count and print song file names using awk

RANK NAME BAND YEAR GENERE DOMESTIC/INTERNATIONAL 206:Reach Out, I'll Be There:The Four Tops:1978:Pop:3/2 207:Bye Bye Love:The Everly Brothers:1950:Classic:3/2 ...