Skip to content

Instantly share code, notes, and snippets.

@azman0101
Created February 4, 2016 09:48
Show Gist options
  • Save azman0101/dd41d95a3be0caa8745f to your computer and use it in GitHub Desktop.
Save azman0101/dd41d95a3be0caa8745f to your computer and use it in GitHub Desktop.
Remove last line from files with specific string
find ./ -type f -name "*.java" -exec grep -l "Location:" {} \; -exec sed -i ':a;$!N;1,4ba;P;$d;D' "{}" \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment