Linux tidy up

ref doc

 * http://linux.vbird.org/

curl

 * Transfer a url

curl -d 'hi, the content' http://localhost:3003
 * curl post method, curl -d (--data)

curl http://localhost:3003
 * curl get method

// -D -, dump header to standard output // -#, progress bar
 * curl -# -D - -o /dev/null -H "User-Agent:iphone" "http://www.reuters.com/article/2014/03/26/idUSnMKW40mwTa+1c2+MKW20140326"

lokvins-MacBook-Pro:yufei lokvin$ curl -# -D - -o /dev/null -H "User-Agent:iphone" "http://www.reuters.com" HTTP/1.1 302 Moved Temporarily Server: AkamaiGHost Content-Length: 0 Location: http://mobile.reuters.com/do/urlRedirect?URL=http%3A%2F%2Fwww.reuters.com/ Date: Wed, 02 Jul 2014 14:26:32 GMT Connection: keep-alive Vary: User-Agent

//download specify html response to r.html file
 * curl -# -o r.htm "http://www.reuters.com"

wget

 * non-interactive network downloader, supports http, https, ftp

wget -O - "http://www.reuters.com"
 * 1) -O file, if - used as file, documents will be printed to standard output

wget -O r.htm "http://www.reuters.com"

screen
1) screen -L -d -RR -S buildmaster; -> Start a screen as the buildmaster user;  1) screen -S buildmaster -> also start new screen 2) screen -x; -> resume to last screen;  n) screen -list -> show available screen list 3) ctrl-a d;  -> quit current screen, Detached;  4) ctrl-a 1/2/3/4...;   -> switch in different window; 5) ctrl-a c;  -> Create a new window in the screen;  6) ctrl-a shift-A;  -> Change the window name in the screen; 7) ctrl-a " -> list all window  8) ctrl-a [ + arrow key -> copy mode, can roll screen, press "Esc" exit from copy mode  10)ctrl-a + K -> kill current window  11)ctrl-a + ctrl-n -> move to next window  12)ctrl-a + ctrl-Backspace -> move to previous window   13)ctrl-a + a, move cursor to the line begin

screen guide : http://magazine.redhat.com/2007/09/27/a-guide-to-gnu-screen/

find

 * find, walk a file hierarchy

shell> find ~/.m2 -name "commons-beanutils-*.jar"
 * find by name in specify folder

shell> find ~ ~/.m2 -name "commons-beanutils-*.jar"
 * 1) find in two folder ~ and ~/.m2 for name is commons-beanutils-*.jar

shell> find ~/.m2 -iname "commons-beanutils-*.jar"
 * 1) find by name and case insensitive

shell>find. -mtime -1
 * 1) find file modified time less than 1 day, this command very useful for finding prod issue

shell>find. -mtime +1
 * 1) find file modified time larger than 1 day

shell> find. -mmin -60
 * 1) find file modified time less than 60 minutes