05-26-2009
compare files in two directories and output changed files to third directory
I have searched about 30 threads, a load of Google pages and cannot find what I am looking for. I have some of the parts but not the whole. I cannot seem to get the puzzle fit together.
I have three folders, two of which contain different versions of multiple files, dist/file1.php dist/file2.php etc and dist_old/file1.php dist_old/file2.php etc.
The third folder contains only the changed files between the two. If /dist/file1.php differs from /dist_old/file1.php then a file named dist_upgrade/file1.php exists with the same contents as dist/file1.php.
Currently I am manually coping the different files using winmerge and I would like to automate some of this if possible.
What I would like to do is compare the dist folder with the dist_old folder then have files that are not the same copied to dist_upgrade/file.ext retaining the directory structure and full contents of the new file in the dist folder.
Thanks for any advice,
Best Regards,
Brandon
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I need to compare two flat files (yesterday & today's data) and get only the changed data from flat files. In flat file i dont have data column or anything its just a string data in flat file.Can any one please let me know the script
With Regds
Shashi (3 Replies)
Discussion started by: jtshashidhar
3 Replies
2. Shell Programming and Scripting
Hello,
Using the instruction mget (within ftp) and with "Interactive mode off", I want to get all files from directory (DirAA), but not the files in sub-directories.
The files names don't follow any defined rule, so they can be just letters without (.) period
Directory structure example: ... (0 Replies)
Discussion started by: Peter321
0 Replies
3. UNIX for Dummies Questions & Answers
Hello I am very new to Unix. I am actually using the C shell to write a program that will compare all the files in the directory and subdirectores and print out the ones that are identical, I am assuming identical by name or text
Thank you (2 Replies)
Discussion started by: ga.miami56
2 Replies
4. Shell Programming and Scripting
Can anyone come up with a unix command that lists
all the files, directories and sub-directories in the current directory
except a folder called log.?
Thank you in advance. (7 Replies)
Discussion started by: Manjunath B
7 Replies
5. UNIX for Dummies Questions & Answers
Hi All,
I have two directories that has some files, some of the files are common to both of them like :
ls -l dir1
file1
file2
file3
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... (2 Replies)
Discussion started by: mukulverma2408
2 Replies
6. UNIX for Advanced & Expert Users
Find all files in the current directory only excluding hidden directories and files.
For the below command, though it's not deleting hidden files.. it is traversing through the hidden directories and listing normal which should be avoided.
`find . \( ! -name ".*" -prune \) -mtime +${n_days}... (7 Replies)
Discussion started by: ksailesh1
7 Replies
7. Shell Programming and Scripting
Hi all,
I have 2 directories dir1 and dir2 which contains many xml files. I need to compare files of dir1 with that of dir2 and if they match, I need to cut it from dir1 and paste it in dir2. I need to do this thru scripts. I'm currently investigating on the diff command. Please help me write... (6 Replies)
Discussion started by: frum
6 Replies
8. AIX
Hello,
Server A: /directory1/
Server B: /Backups/
i wanted to backup contents of /directory1 from "server A" on to "Server B" every 1 hour.
If there is any change in (only new/differences) contents on serverA (directory1/) supposed to be backeup on next run.
I did used rsync command to... (5 Replies)
Discussion started by: System Admin 77
5 Replies
9. Shell Programming and Scripting
Hi,
I am using Sun Solaris - SunOS. I have two fixed width files shown below. I am trying to find the changes in the records in the Newfile.txt for the records where the key column matches. The first column is a key column (example: A123).
If there are any new or deletion of records in the... (4 Replies)
Discussion started by: Saanvi1
4 Replies
10. Shell Programming and Scripting
Hey
im working on script that can compare 2 directory and check difference, then copy difference files in third diretory.
here is the story:
in folder one we have 12 subfolder and in each of them near 500 images hosted.
01 02 03 04 05 06 07 08 09 10 11 12
in folder 2 we have same subfolder... (2 Replies)
Discussion started by: nimafire
2 Replies
fixman(1M) fixman(1M)
NAME
fixman - fix manpages for faster viewing with man command
SYNOPSIS
alt-path]
DESCRIPTION
The command is a shell script that processes manpages in the directories to unexpand spaces to tabs where possible, and to remove all char-
acter-backspace pairs (which usually exist to cause overstriking or underscoring for printer output). Removal of unnecessary character
sequences improves the speed of man(1), and reduces disk space consumption. The command should be run after using to create formatted,
manpages from unformatted, source files (see catman(1M)).
By default, searches for subdirectories in the following parent directories in the order indicated:
o
o
o
If the environment variable is set, the directory paths specified by are searched instead of the default. See environ(5) for a description
of the environment variable.
The command does not remove duplicate blank lines. Thus, all files remain a multiple of one page (66 lines) long and can still be passed
directly to (see lp(1)). (Note that man(1) normally uses to accomplish this removal.)
To ensure success, should be run by a user who has appropriate privileges. It will take awhile to complete depending on system speed,
load, memory size, etc. As a side-effect, file ownerships and permissions may be changed.
Options
Perform actions based on the given alternate root.
With this option, alt-path will be prepended to all directory paths, including default paths or the paths defined by
EXTERNAL INFLUENCES
Environment Variables
if set, defines the directories to be searched for manpages.
WARNINGS
If the value of is not the same while is running as it was when was run or when manpage files were installed, some files may be missed and
not processed (see catman(1M)).
EXAMPLES
Run fixman from a server to fix the manpages on a diskless under the alternate root
This will fix manpages in directories under:
FILES
Directories containing [compressed]
nroff(1)-formatted versions of manpages
AUTHOR
was developed by HP.
SEE ALSO
catman(1M), chmod(1), expand(1), lp(1), man(1), mv(1), sed(1), environ(5).
fixman(1M)