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

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -