UNIX utility to find difference in folder, file and contents of file against a base version
Hi,
I am trying to find out whether there are any Unix utilities that compares folders, files and contents within the file and provides a comprehensive report. The comparison can be against base version of a folder and file with content. Can you please let me know of such a utility?
You can also have a look at the diff command. Files only in one directory tree will be marked in Only in ..... messages, so you could select those from all your output perhaps:-
An alternate might be to find all files in the directories and get the checksums into a pair of files, which you can then use diff against, something like:-
This will list out different checksums and files in only one of the directories. It depends what you want.
Do either of these help?
Robin
Last edited by rbatte1; 11-25-2016 at 05:27 AM..
Reason: Correcting an error
It is no longer required by the standards, but many systems still have a dircmp utility that can be used to compare the file hierarchies rooted in two directories looking for added, missing, and common files and (for files that are present in both hierarchies) it can also provide a diff listing for differences between those files.
This User Gave Thanks to Don Cragun For This Post:
Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 2,288
Thanks Given: 430
Thanked 480 Times in 395 Posts
Hi, jgt .
For The Shell Corner: cmptree | Dr Dobb's ,about half-way down the page, starts with:
Once you get cmptree working, it can be a useful addition to one's toolbox because you can take it with you.
Hi All,
I want to find difference between two files and output only lines which are not present in second file .I am using awk and I am getting only the first difference but I want to get all the lines which are not present in file2 .Below is the code I am using . Please help to get the desired... (7 Replies)
Hi one of the output of the command is as below
# sed -n "/CCM-ResourceHealthCheck:/,/---------/{/CCM-ResourceHealthCheck:/d;/---------/d;p;}" Automation.OutputZ$zoneCounter | sed 's/$/<br>/'
Resource List : <br>
*************************** 1. row ***************************<br>
... (2 Replies)
Hi All,
I want to copy all the contents of a list of files in a folder to a particular file. i am using following command:
cat dir/* >> newFile.txtIt's not working.
Could you please help?
Thanks,
Pranav (3 Replies)
I need to replace all filesnames in a folder as well as its content from AK6 to AK11. Eg Folder has files AK6-Create.xml, AK6-system.py etc.. the files names as well as contents should be changes to AK9-Create.xml, AK9-system.py etc
All files are xml and python scripts.
---------- Post... (0 Replies)
Hello,
I have a file with tab delimited columns like:
File1
A 2 C R
F 4 D Q
C 9 A B
......
I want to grep out the lines in a second file, File2, corresponding to each line in File1
Can I do this:
while read a b c d
do
grep '$a\t$b\t$c\t$d' File2 >>... (2 Replies)
Hello,
I was wondering how to make difference between file and folder while using ls -l?
I see it on the output because "d" is for dir and "-" for file, but how to make this input to other command?
Because I am trying to bzip2 if it's the file and tar if it's a directory. (9 Replies)
Hello guys
I am sure that you will help me on this issue as you did earlier::)
Scenario :
I have a folder named "XYZ". It consist many sub-folders and subfolder contain severals files. there may be abc.dat in each subfolder. Now i want to seperate subfolders on follwing conditions-
if abc.dat... (12 Replies)
Hi All,
Please help me out
1) Command to find the disk usage in GB. I know that du -k will give in kilobites.
2) How to find the Biggest file/folder in a given set of files/folders.
Thanks in advance
Regards,
Manas (8 Replies)
Hi,
I have a .txt file which has to be compared with a folder and print the difference to some other .txt file.
I did try with the diff command..i mean
diff /tmp/aaa/bbb.txt /space/aaa/bbb/
/***bbb.txt contains all the files names which may or may not exist in the folder bbb..so i need... (2 Replies)