To find a file name with some similar characters as another file in unix -
i have 2 files similar string in name, want search second file correspondent file in unix
for eg:-
filename1: - abc.flag.1502624856 filename2:- abc.n.1502654789
my doubt when find flag file how find correspondent n file.
man agrep
:
name agrep - search file string or regular expression, approxi‐ mate matching capabilities
let's try it:
$ ls | grep -v abc.flag.1502624856 > file # remove searched file $ agrep -b -y abc.flag.1502624856 file agrep: 1 word matches within 8 errors abc.n.1502654789
since it's approximate pattern matching there might false positives.
Comments
Post a Comment