Sponsored Content
Top Forums Shell Programming and Scripting Compare two folders and file content Post 302921795 by rohit_shinez on Monday 20th of October 2014 11:03:42 AM
Old 10-20-2014
Hi,

You are close to the approach but what i need is like below to print the output in restive log files

Code:
f1.log - There is a difference in the f1 and f2, please find the below difference:
......
f2.log - No difference found
f3.log - No difference found
Additional.log - There is additional file in D2 with filename as f4

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remote compare of folders

Hi, Is there a way (either commands/tools/scripts/logic) to compare two given folders on different unix boxes. I want to compare folder a in Unix box 'A' with folder 'b' in Unix box 'B'. I can run the script in Unix box 'A'. I am looking. for following results: files/sub folders only in a... (1 Reply)
Discussion started by: sunilav
1 Replies

2. Shell Programming and Scripting

To Compare content of one file with other file

Hi All, I need to compare the content of one file with the other.The first file holds the records: aaa ,123 bbb,321 ccc,890 Second file willl holds the record aaa,bbb,ccc My problem is i need to take the first column of file one and compare with the first row of second file.If it... (1 Reply)
Discussion started by: ithirak17
1 Replies

3. UNIX for Dummies Questions & Answers

To compare selective file in different folders

Hello, I am using dircmp -d <folde1> <Folder2> to compare the files from two different foldes, but this command compares for all the files. Is there any option to select only some files for comparision. For example in Folder1: file1.txt file2.txt file3.txt Folder2 file1.txt file2.txt... (0 Replies)
Discussion started by: gmahesh2k
0 Replies

4. Shell Programming and Scripting

Compare 2 folders...

Hello, I try to compare 2 folders, i explain, i have file in this 2 folder and i want to print out the difference in this folders... ex: folder1: file1 file2 file3 folder2: file1 file2 print file3 I do a ls of the 2 folders and i use the command diff (diff $var1 $var2) without... (8 Replies)
Discussion started by: protocomm
8 Replies

5. Shell Programming and Scripting

split file content into specific folders

Hi I have a large text file and I want to split its content into multiple flies. this large file contains several blocks of codes separated by a comment line for each block. this comment line represents a directory path So, when separate these blocks each into a separate file, This output... (7 Replies)
Discussion started by: turki_00
7 Replies

6. Shell Programming and Scripting

Bash selective copy folders and content to another location

I'm looking for a bash scrypt to copy some folders and some of the content to another location. I'm a teacher and very noobish with programming language anyway what I'm looking for , I have this director structure Main director "Students" with subfolders "john";"daisy";"work" etc .. and some of... (2 Replies)
Discussion started by: brickleul
2 Replies

7. Shell Programming and Scripting

Ksh: how compare content of a file with an other array

Hi, I created a skript in ksh which generate a file with semicolon as separator, this is an example of the file a created: example content file: hello;AAAA;2014-08-17 hello;BBBB;2014-08-17 hello;CCCC;2014-08-17 I would need to compare the content in of the second column of this file... (3 Replies)
Discussion started by: jmartin
3 Replies

8. Shell Programming and Scripting

Move multiple files 4rm Source to different target folders based on a series num in the file content

Dear Experts my scenario is as follows... I have one source folder "Source" and 2 target folders "Target_123456" & "Target_789101". I have 2 series of files. 123456 series and 789101 series. Each series has got 3 types of fiels "Debit", "Refund", "Claims". All files are getting... (17 Replies)
Discussion started by: phani333
17 Replies

9. Shell Programming and Scripting

Compare & print content of file which is not matching

Hi All I want to compare 2 files using awk and get output of content which is not matching I have 2 files a.txt 123 456 780 143 b.txt A|B|C|167|D|E C|K|D|123|D|E A|B|D|789|G|F C|D|G|143|A|B Not matching line from b.txt O/P A|B|C|167|D|E A|B|D|789|G|F (3 Replies)
Discussion started by: aaysa123
3 Replies

10. Shell Programming and Scripting

Script to compare files in 2 folders and delete the large file

Hello, my first thread here. I've been searching and fiddling around for about a week and I cannot find a solution.:confused: I have been converting all of my home videos to HEVC and sometimes the files end up smaller and sometimes they don't. I am currently comparing all the video files... (5 Replies)
Discussion started by: Josh52180
5 Replies
MERGELOGS(1)						      General Commands Manual						      MERGELOGS(1)

NAME
mergelogs - merge and consolidate web server logs SYNOPSIS
mergelogs -p penlog [-c] [-d] [-j jitter] [-t seconds] server1:logfile1 [server2:logfile2 ...] EXAMPLES
mergelogs -p pen.log 10.0.0.1:access_log.1 10.0.0.2:access_log.2 mergelogs -p pen.log 10.0.18.6:access_log-10.0.18.6 10.0.18.8:access_log-10.0.18.8 DESCRIPTION
When pen is used to load balance web servers, the web server log file lists all accesses as coming from the host running pen. This makes it more difficult to analyze the log file. To solve this, pen creates its own log file, which contains the real client address, the time of the access, the target server address and the first few bytes of the requests. Mergelogs reads pen's log file and the log files of all load balanced web servers, compares each entry and creates a combined log file that looks as if the web server cluster were a single physical server. Client addresses are replaced with the real client addresses. In the event that no matching client address can be found in the pen log, the server address is used instead. This should never happen, and is meant as a debugging tool. A large number of these indicates that the server system date needs to be set, or that the jitter value is too small. You probably don't want to use this program. Penlog is a much more elegant and functional solution. OPTIONS
-c Do not cache pen log entries. The use of this option is not recommended, as it will make mergelogs search the entire pen log for every line in the web server logs. -d Debugging (repeat for more). -p penlog Log file from pen. -j jitter Jitter in seconds (default 600). This is the maximum variation in time stamps in the pen and web server log files. A smaller value will result in a smaller pen log cache and faster processing, at the risk of missed entries. -t seconds The difference in seconds between the time on the pen server and UTC. For example, this is 7200 (two hours) in Finland. server:logfile Web server address and name of log file. AUTHOR
Copyright (C) 2001-2003 Ulric Eriksson, <ulric@siag.nu>. SEE ALSO
pen(1), webresolve(1), penlog(1), penlogd(1) LOCAL MERGELOGS(1)
All times are GMT -4. The time now is 09:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy