Finding a unique file

Viewed 52

Is there a way I can find a unique/modified file?

I have two text files with hash and names eg:

file1.txt:

   c3f2b563b3cb091esada5b40fbfd5e60f526da3d *10.88.10/1.xml
   770aafff757f83e55c4cadaad7144e512299788d *10.88.10/config/2.csv
   38045a78f87addaddada4c3754bea76c72cbfe25 *10.88.10/3.txt
   asddd132dfdada1231431411ddsfadfgdkkgdada *10.88.10/4.js

file2.txt:

c3f2b563b3cb091esada5b40fbfd5e60f526da3d *10.88.12/1.xml
770aafff757f83e55c4cadaad7144e512299788d *10.88.12/config/2.csv
38045a78f87addaddada4c3754bea76c72cbfe25 *10.88.12/3.txt
asddd1222131231231sadsdaddsfadfgdkkgdada *10.88.12/4.js
dadadadawqeqweqwg32542362436532wqrewqr32 *10.88.12/5.py

As you can see some of the files in file1.txt and file2.txt are the same. file2.txt has a file added called 5.js and an updated/modified file named 4.js.

Is there any way I can output modified and added files in file2.txt?

Expected Output:

    10.88.12/4.js
    10.88.12/5.py

I tried the diff command but it shows all files are different because of file name (10.88.10 to 10.88.12).

I tried cut -d' ' f1 but after the diff command I couldn't find a way to output the file name.

1 Answers
Related