LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-25-2009, 12:10 PM   #1
jiobo
Member
 
Registered: Nov 2008
Posts: 180

Rep: Reputation: 36
diff on directories with links not working?


Have some directories that I want to compare to see if they are the same. In trying to use the diff command, I get output for symbolic or hard link files that says: "No such file or directory". But if I "ls -l" they are there but as links.

diff GNU utils version 2.8.1
Code:
diff -r --brief /directory1 /directory2
 
Old 11-25-2009, 04:27 PM   #2
Chirel
Member
 
Registered: Nov 2009
Posts: 55

Rep: Reputation: 19
I guess you have symbolic links to files that don't exist.
 
Old 11-25-2009, 04:39 PM   #3
jiobo
Member
 
Registered: Nov 2008
Posts: 180

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by Chirel View Post
I guess you have symbolic links to files that don't exist.
All of the files exist. That is what I meant when they are listed by "ls -l" and if I list those directories, they are there too.

My question is how to get diff to work with links?
 
Old 11-25-2009, 08:03 PM   #4
Chirel
Member
 
Registered: Nov 2009
Posts: 55

Rep: Reputation: 19
Code:
# ln -s /some/file/that/do/not/exist myfile
# ls -l myfile
lrwxrwxrwx 1 bob bob 28 2009-11-26 01:54 myfile -> /some/file/that/do/not/exist
So here ls -l show me a file that is a symbolic link to something that is not here.
No error at all.

if the file named 'myfile' exist on both directory you want to compare, that's the output of diff.
Code:
diff: /home/bob/myfile: No such file or directory
diff WILL follow links during a directory compare.

So i repeat . . . you have broken symlink.
 
  


Reply

Tags
diff, link, symlink


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to compare timestamp of same file residing in two diff directories prasenjit.patra AIX 1 10-21-2009 05:45 PM
Hard links Number and Directories ahmedb72 Solaris / OpenSolaris 2 07-04-2007 02:54 PM
Links for Directories GregSims General 5 08-06-2005 03:53 PM
automatically go to links from page and diff toastermaker Linux - General 3 11-13-2004 10:50 AM
links (directories and devices) PJota Linux - Newbie 1 07-29-2003 11:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration