If I know that file1 and file2 are the same (they are duplicates), is there anyways that I can replace file2 with a hardlink to file1? I tried to use
ln file2 file1
Is this correct? Thanks.
on 01/18/2013 – Made popular on 01/18/2013
For a bash script (not necessarily bash shell, but from what I can tell, bash compatible) I need to compare dates.
Using if you can test if a file is older or newer than another file like so :
[ FILE1 -nt FILE2 ] True if FILE1 has been changed more recently than FILE2, or if FILE1 exists and FILE2 does not.
[ FILE1 -ot FILE2 ] True if FILE1 is older than FILE2, or is FILE2 exists and FILE1 does n
I have 2 big csv files, file1.csv which looks like this
file2.csv which looks like this
These are just random numbers that I made up, basically the two numbers where identical, and sorted. I want to compare file1.csv and file2.csv and then copy the rows that are present in file1.csv but not in file2.csv to file3.csv.