Skip to content

Instantly share code, notes, and snippets.

@memphys
Created April 3, 2012 21:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save memphys/2295763 to your computer and use it in GitHub Desktop.
Save memphys/2295763 to your computer and use it in GitHub Desktop.
usefull bash commands
# find folder or file recursively and delete it
$ find . -name ".git" -exec rm -rf '{}' \;
# compress and archive
$ tar -zcvf archive-name.tar.gz directory-name
# uncompress and unarchive
$ tar -zxvf archive-name.tar.gz
# show changed files through svn revisions
$ svn diff -r r8020:r8390 --summarize
# svn commit with commit message in file
$ svn commit -F commit.txt filename.here
# clear deleted remote branches in local branch-list
$ git remote prune origin
# Pretty HTML in the terminal
$ curl -s -XPOST http://localhost/foo | lynx -stdin -dump
# import MySQL dump
$ mysql -u<username> -p
create database `somedb`;
use `somedb`;
source somedatabasetable.sql;
# move/rename file without retyping it's full name (expands to `mv original.filename new.original.filename`)
$ mv {,new.}original.filename
# mass commands (change extension, for example)
$ for i in source/_posts/*.html; do git mv "$i" "`basename $i .html`.markdown"; done
@toothfairy
Copy link

netstat -nlp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment