Hi,
I am getting crazy after days on looking at it:
Bash in Ubuntu 12.04.1
I want to do this:
pattern="system /path1/file1 file1"
new_pattern=" data /path2/file2 file2"
file to edit: data.db
- I need to search in the file data.db for the nth occurrence of pattern
- pattern must match a complete line
- insert after pattern a new line with new_pattern
Sed in my installe
I want to insert the contents of file1 into file2 after a matching PATTERN. I want to do it only after the first occurrence of the PATTERN.
I would like to know the modification I need to make to the following command for my needs.
sed -i "/PATTERN/r file1" file2
How to search a pattern from multiple files...
i used the command suppose the pattern name is xxx
grep xxx (file1-o- file2-o- file3)
Thanks in advance
How to search a pattern from multiple files...
i used the command suppose the pattern name is xxx
grep xxx (file1-o- file2-o- file3)
Thanks in advance
I have a directory that has 800 files like this:
file1.png
file1@2x.png
file2.png
file2@2x.png
file3.png
file3@2x.png
... etc
I need to create zip files like this
file1.zip (containing file1.png and file1@2x.png)
file2.zip (containing file2.png and file2@2x.png)
file3.zip (containing file3.png and file3@2x.png)
Is there a magic command I can use to do that?
thanks.
I have a directory full of files ending with different extensions, how would I list/select only the files ending with .in and corresponding .out that share the same basename?
e.g.
file1.txt
file1.in
file2.in
file3.in
file2.out
file3.out
What I want to select from these files are:
file2.in
file2.out
file3.in
file3.out
Hi ,
I have two files File1 and File2.In First file i have table names
abc
def
cfg
In second file i have the sql commands
for e.g
replace view def.test1 for access select * from abc.test1;
I have to find the common words from File1 and File2 and printing it in File3
the grep command i am using is
grep -o -f File1 File2|sort|uniq > File3
The problem i am facing is , if i run the above g
For Suppose, i have installed a package having files file1, file2 and file3.
After installation i have removed file3.
But "rpm -qf file3" is giving the package name, even file3 was not there.
And also "rpm -ql package" is also displaying all 3 files.
How can i update rpm about that package to display only available files i.e. file1 and file2 when queried with "rpm -ql"
I have 4 files file1,file2,file3,file4.I have to read each word from file1 and return the count of it in all the 3 remaining files as a whole.How to do dat??
eg:
file1
this is a cat
file2
this is a mat
file3
this is a rat
file4
cat mat rat
Output:
this:2
is:2
a:2
cat:1