Tagged Questions
2
votes
2answers
91 views
Matching two files for similar first line
I have 2 set of files.
File one contains ID's
ex:
1111
2222
6666
3333
4444
File two contains ID and username:
1873 Neil
1111 Roger
7632 Tim
3333 Oscar
8723 Greg
4444 Roy
6666 Patrick
I want to ...
3
votes
5answers
160 views
Print non-existent files from a pipe input
I have a directory of lots of .PDF and .JPG files.
There should be a .JPG file for each .PDF with the same name.
I'm trying to use a command to find .PDF files that doesn't have a .JPG file.
My ...
4
votes
3answers
738 views
shell script to read from multiple files in parallel
I need to write a script that runs parallel and looks for a string in multiple files. I tried a lot of options but they slow down the speed of my processor.
2
votes
2answers
76 views
reformat a text file to have all text on one line using CentOS 5.6
I have a 210-line block of HTML that I have stored in a HTML for debugging purposes.
The HTML, as you would expect, is formatted accordingly so is stored in the file with spaces and tabs. Is it ...
0
votes
1answer
553 views
last modified with grep
I'd like to make a list to stdout of the files modified in the last two hours in the . directory using grep. It has to be automatic (can't ask user what time is it or similar stuff) and I have to use ...
1
vote
1answer
114 views
Listing specific lines in listed files
Find all files in /tmp that are ordinary files and print the lines
that end with Programming.
For this problem I know how to list all files in /tmp.
What I do not know how to do is whether to use ...
5
votes
2answers
480 views
How to grep on source code without catching comments
I search a way to grep on source code without having sometimes false-positive because of comments. For instance if I search on foo on this .c source code :
/*
* foo has changed [...] and is now a ...
2
votes
2answers
404 views
Concatenate specific files into one single file
In a folder containing X files, I need to concatenate Y files (where X > Y) together into a single text file. I have the filenames (of Y files) that I need to concatenate.
Can anyone please help me ...
1
vote
0answers
84 views
How to search for file contents [duplicate]
Possible Duplicate:
Finding a substring in files across subdirectories with a single built-in command?
I know that I can use grep for a single file, but what about a whole directory tree?
6
votes
4answers
2k views
Number of files containing a given string
How can I count the number of files (in a directory) containing a given string as input in bash/sh?