01-10-2019
Be lazy.
Create a new directory Z. Copy all the files in X to Z and all the files in Y to Z then copy Z over top of X and Y. After that, you have to compare the list of files to your master list to find any files that were missing in both.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi there,
say the package is in the ~/ and it's ~/packageFoo.pm
I can use usePackage.pl in ~/ (~/usePackage.pl).
Now, if I move it to ~/subDIR/usePackage.pl, the script won't work because it's not in the same DIR with packageFoo.pm
How can i fix it?
Thanks
Gusla (1 Reply)
Discussion started by: gusla
1 Replies
2. UNIX for Dummies Questions & Answers
Hello all
i wander what is the best way to make diff between 2 directories and perform diff of 2 kinds
the first is the names of the files on each directory , and the second diff is between the content of
each file and the corresponding file and the second dir.
Thanks for the help (5 Replies)
Discussion started by: umen
5 Replies
3. UNIX for Dummies Questions & Answers
Hi,
Does anybody know the cmd to compare two areas and print out the different files w/ path?
I tried cmp and diff and dircmp but with no luck.
Should I grep and print?
For example:
/aa/images/jan
..../images/feb
/bb/images/jan
..../images/feb
i want to print the compare,... (5 Replies)
Discussion started by: andylee80
5 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I want to be able to compare two different files in two different directories. I have a development server set up on one domain and a live server set up on another.....I need to be able to compare files on these two servers.
Any ideas? (2 Replies)
Discussion started by: elduderino
2 Replies
5. UNIX and Linux Applications
I think I've seen out there that there is a command to ignore specific files within a directory when doing a (-R) recursive diff. I've never used this so I was wondering if there was anyone who could provide an example how I would run this. My thoughts are something like:
cvs diff -i <fileName1>... (2 Replies)
Discussion started by: airon23bball
2 Replies
6. Homework & Coursework Questions
i have been asked to write a bash shell script comparing two directories and sed or awk should not be used in this assignment. compdir will compare filenames in two directories, and list information about filenames that are in one directory but not the other. The information listed will be a long... (1 Reply)
Discussion started by: soccerball
1 Replies
7. UNIX for Dummies Questions & Answers
Help regarding effective usage of diff for comparing files
Hi All,
I have few doubts regarding best usage of diff command. I also have some questions with out put of diff command.
File1:
ABC
DEF
File2:
ABC
DEFAA
diff file1 file2
2c2
<DEF
----- (1 Reply)
Discussion started by: sarbjit
1 Replies
8. UNIX for Dummies Questions & Answers
I am looking for a small script to crawl through several directories and change a couple of files in each directory to read write status.
Anyone have any ideas ? (5 Replies)
Discussion started by: zapper222
5 Replies
9. Shell Programming and Scripting
Hi All,
I have transferred some directory structures from server1 to server2 by creating a tar files. Now i need to cross check whether I transferred entire structures or not.
Is there any command to check this on each individual server.
Thanks (2 Replies)
Discussion started by: nag_sathi
2 Replies
10. Shell Programming and Scripting
Hi,
Need help ...I want to create multiple directories in different /file systems using for loop..eg.../ORCL_data01/oradata/orcl/ctl.
../ORCL_data01/oradata/orcl/data.
../ORCL_data01/oradata/orcl/redo.
Script :-
=========
for dir in `ls -d... (8 Replies)
Discussion started by: Linux6.5
8 Replies
CP(1) General Commands Manual CP(1)
NAME
cp, cpdir - file copy
SYNOPSIS
cp [-pifsmrRvx] file1 file2
cp [-pifsrRvx] file ... directory
cpdir [-ifvx] file1 file2
OPTIONS
-p Preserve full mode, uid, gid and times
-i Ask before removing existing file
-f Forced remove existing file
-s Make similar, copy some attributes
-m Merge trees, disable the into-a-directory trick
-r Copy directory trees with link structure, etc. intact
-R Copy directory trees and treat special files as ordinary
-v Display what cp is doing
-x Do not cross device boundaries
EXAMPLES
cp oldfile newfile # Copy oldfile to newfile
cp -R dir1 dir2 # Copy a directory tree
DESCRIPTION
Cp copies one file to another, or copies one or more files to a directory. Special files are normally opened and read, unless -r is used.
-r also copies the link structure, something -R doesn't care about. The -s option differs from -p that it only copies the times if the
target file already exists. A normal copy only copies the mode of the file, with the file creation mask applied. Set-uid bits are cleared
if the owner cannot be set. (The -s flag does not patronize you by clearing bits. Alas -s and -r are nonstandard.)
Cpdir is a convenient synonym for cp -psmr to make a precise copy of a directory tree.
SEE ALSO
cat(1), mkdir(1), rmdir(1), ln(1), rm(1).
CP(1)