Hi
I need to check list of files aganinst a.txt and return those files which are not available in a.txt
ls -lrt
file1.txt
file2.txt
file3.txt
a.txt
=====
file1.txt
file2.txt
Expecting o/p
file3.txt
Thanks,
Akil
Hi
I need to check list of files aganinst a.txt and return those files which are not available in a.txt
ls -lrt
file1.txt
file2.txt
file3.txt
a.txt
=====
file1.txt
file2.txt
Expecting o/p
file3.txt
Thanks,
Akil
var="$(ls -lrt folder | awk 'NF>3{print $NF}')";echo "$var" >>a.txt;cat a.txt | sort | uniq -u
result:
file3.txt
you can use grep
ls -1|grep -v -f a.txt
comm -3 <(ls -1) <(sort a.txt)