Skip to content

Instantly share code, notes, and snippets.

@stephanb
stephanb / git-add-all-rm-all
Last active August 29, 2015 14:10
Git: add all modified files to the index; delete all removed files from the index
git add $(git status | grep "modified:" | cut -d " " -f 4)
git rm $(git status | grep "deleted:" | cut -d " " -f 5)
@stephanb
stephanb / svn-add-all-rm-all
Created December 2, 2014 14:12
SVN: add all modified files; delete all removed files
svn rm $(svn status | grep "^\!" | cut -d " " -f 8)
svn add $(svn status | grep "^?" | cut -d " " -f 8)
@stephanb
stephanb / rename-and-copy-file-matching-a-pattern
Last active August 29, 2015 14:13
Rename and copy/move all files or directories matching a pattern
find . -type f -name "*your-pattern*" | while read oldname; do newname=`echo $oldname | sed 's/your-pattern/substitute-value/g'`; cp $oldname $newname; done