Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Comparing two files and list the difference with common first line content of both files Post 303041024 by sarathy_a35 on Tuesday 12th of November 2019 10:39:26 AM
Old 11-12-2019
@Rudic : Im not sure what is the command you are using ?? Can you explain it ?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

I want to record the difference in the content of files in different directory

Hi All I am very new to the Unix shell scripting ,, could you pleae help me to generate the output file having the filename and path which files having the difference in the contents in the two directory. all files in both directory have the same name and format. input directory /edc/input1/ ... (3 Replies)
Discussion started by: singhald007
3 Replies

2. Solaris

Comparing the common columns of a table in two files

Hi, I have two text files.The first and the 2nd file have data in the same format For e.g. The first file has BOOKS COUNT: 40 BOOKS AUTHOR1 SUM:1018 MAX:47 MIN:1 AVG:25.45 BOOKS AUTHOR3 SUM:181 MAX:48 MIN:3 AVG:18.1 Note:Read it as Table columnname sum(column) max(column) min(column)... (1 Reply)
Discussion started by: ragavhere
1 Replies

3. Shell Programming and Scripting

comparing files content

hi i have a set of files , i need to compare one file content with other file content, i am using cmp -s abc.1 def.2 , but it is not giving theproper o/p even if the content is different.Please help thanks Satya (1 Reply)
Discussion started by: Satyak
1 Replies

4. Shell Programming and Scripting

Comparing 2 csv files and matching content

Hello, I have the following problem: There are two csv files csv-file #1: aaa1, aaa2, ... aaan aaa1, bbb2, ... bbbn aaa1, ccc2, ... cccn bbb1, bbb2, ... bbbn ... zzz1, zzz2, ... zzzn csv-file #2: aaa1, matchvalue1 ccc1, matchvalue2 (7 Replies)
Discussion started by: ghl10000
7 Replies

5. Shell Programming and Scripting

comparing 2 files and creating third file with uncommon content

I want to compare 2 files and create third file with uncommon content. e.g. file1 ajay suhas tom nisha vijay mahish file2 ajay suhas tom nisha expected output file content vijay mahish Is it possible in single command ? Thanks, Ajay (6 Replies)
Discussion started by: ajaypatil_am
6 Replies

6. Shell Programming and Scripting

Comparing text in 2 files and output difference in another file.

I have 2 files of almost same text apart from 2,3 ending lines. Now I want to get that difference in another file. e.g file1.txt is Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_livecd-lv_root 18G 2.4G 15G 14% / tmpfs 504M ... (12 Replies)
Discussion started by: kashif.live
12 Replies

7. Shell Programming and Scripting

Comparing 2 difference csv files

Hello, I have about 10 csv files which range from csv1 - csv10. Each csv file has same type/set of tabs and we have around 5-6 tabs for each of the csv file which have slightly different content(data). A sample of CSV1 is shown below: Joins: Data related to Joins, it can be any number of... (2 Replies)
Discussion started by: bobby1015
2 Replies

8. Shell Programming and Scripting

Find difference in content between two particular lines in two files

I have two files named Before.txt and After.txt: Now i want to find the difference in content between <Marker 1> and <Marker 2> in the two files. ---------- Post updated at 05:00 PM ---------- Previous update was at 04:50 PM ---------- Any help will be highly appreciated..:) (3 Replies)
Discussion started by: proactiveaditya
3 Replies

9. Shell Programming and Scripting

Comparing two files with numbers and taking difference in third file

Hi All, I have two files in the following format, with numbers being defined under columns(described by a set of headers) and rows(again defined by a set of identifiers) 2013 2013 Make200 Make201 Merc BMW Jpur Del ... (9 Replies)
Discussion started by: dev.devil.1983
9 Replies

10. UNIX for Beginners Questions & Answers

Comparing fastq files and outputting common records

I have two files: File_1: @M04961:22:000000000-B5VGJ:1:1101:9280:7106 1:N:0:86 GGCATGAAAACATACAAACCGTCTTTCCAGAAATTGTTCCAAGTATCGGCAACAGCTTTATCAATACCATGAAAAATATCAACCACACCAGAAGCAGCAT + GGGGGGGGGGGGGGGGGCCGGGGGF,EDFFGEDFG,@DGGCGGEGGG7DCGGGF68CGFFFGGGG@CGDGFFDFEFEFF:30CGAFFDFEFF8CAF;;8F ... (3 Replies)
Discussion started by: Xterra
3 Replies
bart(1M)																  bart(1M)

NAME
bart - basic audit reporting tool SYNOPSIS
/usr/bin/bart [create] [ -n] [-R root_directory] [-r rules_file | -] /usr/bin/bart [create] [-n] [-R root_directory] -I [file_name...] /usr/bin/bart [compare] [-i attribute ] [-p] [-r rules_file | -] control-manifest test-manifest bart(1M) is a tool that performs a file-level check of the software contents of a system. You can also specify the files to track and the types of discrepancies to flag by means of a rules file, bart_rules. See bart_rules(4). The bart utility performs two basic functions: bart create The manifest generator tool takes a file-level snapshot of a system. The output is a catalog of file attributes referred to as a mani- fest. See bart_manifest(4). You can specify that the list of files be cataloged in three ways. Use bart create with no options, specify the files by name on the command line, or create a rules file with directives that specify which the files to monitor. See bart_rules(4). By default, the manifest generator catalogs all attributes of all files in the root (/) file system. File systems mounted on the root file system are cataloged only if they are of the same type as the root file system. For example, /, /usr, and /opt are separate UFS file systems. /usr and /opt are mounted on /. Therefore, all three file systems are cataloged. However, /tmp, also mounted on /, is not cataloged because it is a TMPFS file system. Mounted CD-ROMs are not cataloged since they are HSFS file systems. bart compare The report tool compares two manifests. The output is a list of per-file attribute discrepancies. These discrepancies are the differ- ences between two manifests: a control manifest and a test manifest. A discrepancy is a change to any attribute for a given file cataloged by both manifests. A new file or a deleted file in a manifest is reported as a discrepancy. The reporting mechanism provides two types of output: verbose and programmatic. Verbose output is localized and presented on multiple lines, while programmatic output is more easily parsable by other programs. See OUTPUT. By default, the report tool generates verbose output where all discrepancies are reported except for modified directory timestamps (dirmtime attribute). To ensure consistent and accurate comparison results, control-manifest and test-manifest must be built with the same rules file. Use the rules file to ignore specified files or subtrees when you generate a manifest or compare two manifests. Users can compare manifests from different perspectives by re-running the bart compare command with different rules files. The following options are supported: -i attribute ... Specify the file attributes to be ignored globally. Specify attributes as a comma separated list. This option produces the same behavior as supplying the file attributes to a global IGNORE keyword in the rules file. See bart_rules(4). -I [file_name...] Specify the input list of files. The file list can be specified at the command line or read from standard input. -n Prevent computation of content signatures for all regular files in the file list. -p Display manifest comparison output in ``programmatic mode,'' which is suitable for programmatic parsing. The output is not localized. -r rules_file Use rules_file to specify which files and directories to catalog, and to define which file attribute discrepancies to flag. If rules_file is -, then the rules are read from standard input. See bart_rules(4) for the definition of the syntax. -R root_directory Specify the root directory for the manifest. All paths specified by the rules, and all paths reported in the manifest, are relative to root_directory. Note - The root file system of any non-global zones must not be referenced with the -R option. Doing so might damage the global zone's file system, might compromise the security of the global zone, and might damage the non-global zone's file system. See zones(5). OPERANDS
bart allows quoting of operands. This is particularly important for white-space appearing in subtree and subtree modifier specifications. The following operands are supported: control-manifest Specify the manifest created by bart create on the control system. test-manifest Specify the manifest created by bart create on the test system. OUTPUT
The bart create and bart compare commands write output to standard output, and write error messages to standard error. The bart create command generates a system manifest. See bart_manifest(4). When the bart compare command compares two system manifests, it generates a list of file differences. By default, the comparison output is localized. However, if the -p option is specified, the output is generated in a form that is suitable for programmatic manipulation. Default Format filename attribute control:xxxx test:yyyy filename Name of the file that differs between control-manifest and test-manifest. For file names that contain embedded whitespace or newline characters, see bart_manifest(4). attribute The name of the file attribute that differs between the manifests that are compared. xxxx is the attribute value from control-manifest, and yyyy is the attribute value from test-manifest. When discrepancies for multiple attributes occur for the same file, each difference is noted on a separate line. The following attributes are supported: acl ACL attributes for the file. For a file with ACL attributes, this field contains the output from acltotext(). all All attributes. contents Checksum value of the file. This attribute is only specified for regular files. If you turn off context checking or if checksums cannot be computed, the value of this field is -. dest Destination of a symbolic link. devnode Value of the device node. This attribute is for character device files and block device files only. dirmtime Modification time in seconds since 00:00:00 UTC, January 1, 1970 for directories. gid Numerical group ID of the owner of this entry. lnmtime Creation time for links. mode Octal number that represents the permissions of the file. mtime Modification time in seconds since 00:00:00 UTC, January 1, 1970 for files. size File size in bytes. type Type of file. uid Numerical user ID of the owner of this entry. The following default output shows the attribute differences for the /etc/passwd file. The output indicates that the size, mtime, and con- tents attributes have changed. /etc/passwd: size control:74 test:81 mtime control:3c165879 test:3c165979 contents control:daca28ae0de97afd7a6b91fde8d57afa test:84b2b32c4165887355317207b48a6ec7 Programmatic Format filename attribute control-val test-val [attribute control-val test-val]* filename Same as filename in the default format. attribute control-val test-val A description of the file attributes that differ between the control and test manifests for each file. Each entry includes the attribute value from each manifest. See bart_manifest(4) for the definition of the attributes. Each line of the programmatic output describes all attribute differences for a single file. The following programmatic output shows the attribute differences for the /etc/passwd file. The output indicates that the size, mtime, and contents attributes have changed. /etc/passwd size 74 81 mtime 3c165879 3c165979 contents daca28ae0de97afd7a6b91fde8d57afa 84b2b32c4165887355317207b48a6ec7 Manifest Generator The manifest generator returns the following exit values: 0 Success 1 Non-fatal error when processing files; for example, permission problems >1 Fatal error; for example, invalid command-line options Report Tool The report tool returns the following exit values: 0 No discrepancies reported 1 Discrepancies found >1 Fatal error executing comparison Example 1: Creating a Default Manifest Without Computing Checksums The following command line creates a default manifest, which consists of all files in the / file system. The -n option prevents computation of checksums, which causes the manifest to be generated more quickly. bart create -n Example 2: Creating a Manifest for a Specified Subtree The following command line creates a manifest that contains all files in the /home/nickiso subtree. bart create -R /home/nickiso Example 3: Creating a Manifest by Using Standard Input The following command line uses output from the find(1) command to generate the list of files to be cataloged. The find output is used as input to the bart create command that specifies the -I option. find /home/nickiso -print | bart create -I Example 4: Creating a Manifest by Using a Rules File The following command line uses a rules file, rules, to specify the files to be cataloged. bart create -r rules Example 5: Comparing Two Manifests and Generating Programmatic Output The following command line compares two manifests and produces output suitable for parsing by a program. bart compare -p manifest1 manifest2 Example 6: Comparing Two Manifests and Specifying Attributes to Ignore The following command line compares two manifests. The dirmtime, lnmtime, and mtime attributes are not compared. bart compare -i dirmtime,lnmtime,mtime manifest1 manifest2 Example 7: Comparing Two Manifests by Using a Rules File The following command line uses a rules file, rules, to compare two manifests. bart compare -r rules manifest1 manifest2 See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWbart | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ find(1), bart_manifest(4), bart_rules(4), attributes(5) The file attributes of certain system libraries can be temporarily altered by the system as it boots. To avoid triggering false warnings, you should compare manifests only if they were both created with the system in the same state; that is, if both were created in single-user or both in multi-user. 6 Apr 2005 bart(1M)
All times are GMT -4. The time now is 01:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy