Pages

Thursday, December 13, 2012

vim open remote file via ssh


command:

vim scp://userid@remotePc//path/to/file

this command will prompt for password on

grep for multiple strings


command:

grep "string1\|string2\|string3"

gdb debug with different library path


$ gdb
(gdb) set solib-absolute-prefix ./libdir
(gdb) file ./a.out
(gdb) core-file ./a.core

Monday, December 10, 2012

linux: execute particular history command

suppose you want to execute a particular command out of N history commands:

$history

...
...
...

1992  pwd
 1993  clear
 1994  cd foo
 1995  ls
 1996  ./a.out
 1997  ls -als <<== if you want to execute this command, run "!1997 " on terminal
 1998  ssh bar
 1999  ping bar
  2000  history
$!1997


Tuesday, November 20, 2012

sed search lines and comment out or uncomment



comment out..


             sed '/pattern/s/^/#/' 

uncomment out...
             sed '/pattern/s/^/# *//'