Created
April 3, 2012 21:53
-
-
Save memphys/2295763 to your computer and use it in GitHub Desktop.
usefull bash commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
netstat -nlp