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
file2 contains lakhs of records and not in sorted order
i want to retrive only the records from file2 by searcing the first field of file 1
grep ^1 file2 >out.txt
grep ^2 file2 >>out.txt
grep ^3 file2>>out.txt
this i need to do 3 time