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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -