Skip to content

Instantly share code, notes, and snippets.

@marcocaboni
Last active February 8, 2016 09:27
Show Gist options
  • Select an option

  • Save marcocaboni/2645091 to your computer and use it in GitHub Desktop.

Select an option

Save marcocaboni/2645091 to your computer and use it in GitHub Desktop.
Bash tips
# File name from fullpath
find . -name *.sql | sed 's/^.*\///'
# or also
find . -name *.sql -exec basename {} \;
# delete folders containing big old files
find . -size +50M -mtime +150 -exec dirname {} \; | grep -v cache | xargs rm -rf
# execute a command in each sub-directory
for D in `find . -mindepth 1 -maxdepth 1 -type d`; do (cd $D && svn ci -m "commit post release" && cd -); done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment