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
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
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"
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
Hi guys,
I want to compare file1 and file2 using awk. And then using the output to file3.
file1
4
3
2
file2
5
10
1
So the output in file3 would be
1
7
1
Any idea on how to do this? I'm a newbie:oops:
Thx in advance
How do I keep a file pattern from evaluating?
I want to pass in a file pattern to a script as a parameter, and then use that pattern in subsequent statements, but I can't get the pattern to not evaluate before I use it.
For example, if I have 3 files called file1.txt, file2.txt and file3.txt and in my script I have something like this:
num=`ll $1 | wc -l`
and I pass file*.txt in as my para
I have 2 directories
DIR1 contains file1, file2
DIR2 contains file1, file3
Is there a way to replicate DIR1 to DIR2.
means,
if i give,
cp -r DIR1/* DIR2
file1 in DIR2 gets replaced with file1 in DIR1.
file2 in gets copied to DIR2.
file3 remains untouched.
But, i need DIR2 to be the exact replica of DIR1.
I have been using awk to sum up multiple files, this is used to sum up the summary of server log parsing values, it really does speed up the final overall count but I have hit a minor problem and the typical examples I have hit on the web have not helped.
Here is the example:
cat file1
aa 1
bb 2
cc 3
ee 4
cat file2
aa 1
bb 2
cc 3
dd 4
cat file3
aa 1
bb 2
cc 3
ff 4
And the script:
cat test.
Hi All,
I have two directories that has some files, some of the files are common to both of them like :
Code:
ls -l dir1
file1
file2
file3
Code:
ls -l dir2
file1
file2
file3
file4
file5
Now i want to get the files from dir2 that are not present in dir1 (means i want to get file3,file4,file5).