Easiest way to compare two file lists in bash? -
i have directory files frame*
(schema) , input_frame*
(schema), frame
, input_frame
prefixes 2 different types of files. if 1 takes characters after prefixes , compares 2 file lists, set of files frame*
subset of set input_frame*
.
i'd remove files in input_frame*
don't have equivalent member in frame*
. there easy way in bash?
you can use:
for f in input_frame*; [[ ! -f "${f#input_}" ]] && echo rm "$f"; done
once you're satisfied output remove echo
.
Comments
Post a Comment