Is it possible to use any sort of diff utility to diff based on filename only, excluding the file extensions? I have multiple dirs that have various versions of a file, ie media.mov, media.mp4, media.jpg, etc. I want to make sure all versions were made for each file (1000s). So /dir1/media_99.mov and /dir2/media_99.mp4 would yield a TRUE condition. Man diff
Tag: diff
Linux: what’s a fast way to find all duplicate files in a directory?
I have a directory with many subdirs and about 7000+ files in total. What I need to find all duplicates of all files. For any given file, its duplicates might be scattered around various subdirs and may or may not have the same file name. A duplicate is a file that you get a 0 return code from the diff
Using git diff to replicate changes in another directory
I have multiple websites structured (simplified) as follows under a single GIT repository: I did some amendments in /site-1/index.js, /site-1/package.json and added a file /site-1/changes.md. The changes were done in 2 separate git commit in a feature branch called feature/carousel. I want to apply the same changes in /site-2 and /site-3. I’ve tried the following: git format-patch master -o patches
Find out missing files between two directories (missing file names, but not extension) in Linux
Say I have dir1/ that has 1.a 2.a 3.a 5.a and dir2/ has 1.b 2.b 3.b 4.b 5.b. I wonder how can I ignore the extension, and find the missing file (4.b in this case). I assume that diff command doesn’t work as I don’t see relevant argument. Answer You can use the basename command to strip the basename: Then
How to filter a “diff” command to exclude certain entries?
I have to take some text my professor has given me, put it into two files, and I have to use the “diff” function to compare those two files. But, some lines in those files are missing an entry in the 6th (last) column. I need to filter the diff command to exclude those lines. I tried to use the
How to compare two files containing many long strings then extract lines with at least n consecutive identical chars?
I have 2 large files each containing long strings separated by newlines in different formats. I need to find similarities and differences between them. The Problem is that the formats of the two files differ. File a: File b: So now I want to extract the whole line containing NjA5MDAxNdaeag0NjE5NTIx.XUwXRQ.gat8MzuGfkj2pWs7z8z-LBFXQaE from File a to a new file and also delete
compare two words, 1st word = file name appended with date and 2nd word = just date alone. compare should display the lines with different date [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago. Improve this question I am writing a script to compare the file name appended with date(YYY-MM-DD) with date of the file modified. Example:
emailing diff output between two files only if there is a difference
How can I email the output between file1 and file2 but only if there is a difference? Lets say I’m using a shell script. Answer Use the || concatenation. More info here
How to make diffstat count removed and newly added files to LOC count?
this is similar to git diff –stat, but diffstat is ignoring “Only in dir1” and “Only in dir2” files, whereas git diff adds it to deletion and insertion counts respectively. Is there a way to make diffstat to do the same? Answer Simpler: using GNU diff’s -N option, e.g., when comparing directories: If only one file exists, diff normally does
Find differences between files only on lines with specific words [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question