Find for all features in {{file_1}}.bed the closest one in {{file_2}}.bed and write their distance in an extra column (input files must be sorted)
bedtools closest -a {{path/to/file_1}}.bed -b {{path/to/file_2}}.bed -d
bedtools closest -a {{path/to/file_1}}.bed -b {{path/to/file_2}}.bed -d