Skip to content

Instantly share code, notes, and snippets.

@imchao9
Last active April 19, 2017 04:05
Show Gist options
  • Save imchao9/f6975eec802d3b2724a62c07f304ff2f to your computer and use it in GitHub Desktop.
Save imchao9/f6975eec802d3b2724a62c07f304ff2f to your computer and use it in GitHub Desktop.
find the similar file name and delete them
#! /bin/bash
find . -name "*.js" -type f -exec sh -c 'for i do declare match_file=$i; if [ -f $i.map ]; then rm -rf $match_file.map; rm -rf $match_file; echo $match_file.map;fi;done' sh {} +
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment