REGULAR EXPRESSION WITH GREP – DOT

grep searches the named input FILEs (or standard input if no files are named, or if a single hyphen-minus (-) is given as file name) for lines containing a match to the given PATTERN. By default, grep prints the matching lines. commandline session $ cat first.txt name-jeffrin Age-35 Sex-Male $ grep 3. first.txt Age-35 $ …

google chrome HANGUP .BACKTRACE

commandline session (gdb) bt #0  0x00007fd461dbeac3 in *__GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=100) at ../sysdeps/unix/sysv/linux/poll.c:87 #1  0x00007fd46643f4d4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #2  0x00007fd46643f5f4 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #3  0x00007fd468940c00 in ?? () #4  0x00007fd468918832 in ?? () #5  0x00007fd4686349ff in ?? () #6  0x00007fd46a2e8811 in ?? () #7  0x00007fd46a2ea31d in ?? () #8  …

pstree command in linux I

Commandline Session $pstree -pA init(1)-+-/usr/sbin/apach(2306)-+-/usr/sbin/apach(4451) |                       |-/usr/sbin/apach(4452) |                       |-/usr/sbin/apach(4453) |                       |-/usr/sbin/apach(4454) |                       `-/usr/sbin/apach(4455) |-NetworkManager(2145)-+-dhclient(4539) |                      |-{NetworkManager}(2196) |                      `-{NetworkManager}(4540) |-accounts-daemon(2233)—{accounts-daemon}(2235) |-at-spi-bus-laun(3756)-+-dbus-daemon(3761) |                       |-{at-spi-bus-laun}(3758) |                       |-{at-spi-bus-laun}(3760) |                       `-{at-spi-bus-laun}(3762) |-at-spi2-registr(3764)—{at-spi2-registr}(37100) |-atd(2334) |-atop(2361) |-avahi-daemon(2372)—avahi-daemon(2373) |-bluetoothd(2399) |-colord(3919)—{colord}(3928) |-colord-sane(3931)-+-{colord-sane}(3935) |                   `-{colord-sane}(4015) |-console-kit-dae(2237)-+-{console-kit-dae}(2238) |                       |-{console-kit-dae}(2239) |                       |-{console-kit-dae}(2240) |                       |-{console-kit-dae}(2241) |                       |-{console-kit-dae}(2242) |                       |-{console-kit-dae}(2243) |                       |-{console-kit-dae}(2244) |                       |-{console-kit-dae}(2245) |                       |-{console-kit-dae}(2246) |                       |-{console-kit-dae}(2247) |                       …

regular expression — PHP

commandline session <?php $text = “Hello World”; if ( preg_match( “/r.*?d/”, $text, $array ) ) { print “<pre>n”; print_r( $array ); print “</pre>n”; } ?> note: preg_match — Perform a regular expression match source : www.phpcode.net OUTPUT $ 4.2.36 13 513—> php rep.php PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php5/20100525/suhosin.so’ – /usr/lib/php5/20100525/suhosin.so: …

Examining /etc/passwd file in Typical Unix-like OS

ABOUT /etc/passwd file The /etc/passwd file is a text-based database of information about users that may log into the system or other operating system user identities that own running processes. In many operating systems this file is just one of many possible back-ends for the more general passwd name service. The file’s name originates from …

GREP SEARCH STRING USING BACKTICK

$ 4.2.36 7 507—> grep `whoami` algorithm.c to jeffrin@rocketmail.com $ 4.2.36 8 508—> $ 4.2.36 8 508—> whoami jeffrin $ 4.2.36 9 509—> $ 4.2.36 3 503—> grep ls ls2.wav Binary file ls2.wav matches $ 4.2.36 4 504—> grep `ls` ls2.wav grep: 12: Is a directory grep: 2008: Is a directory grep: 2010: Is a …

SEARCH AND REPLACE USING SED

commandline session $ 4.2.36 13 513—> cat math.html <html> <body> <msup> <mfenced> <mi>a</mi> <mo>+</mo> <mi>b</mi> </mfenced> <mn>2</mn> </msup> </body> </html> $ 4.2.36 14 514—> $ sed “s/html/HTML/g” math.html > math-new.html bash: $: command not found $ 4.2.36 15 515—> sed “s/html/HTML/g” math.html > math-new.html $ 4.2.36 16 516—> cat math-new.html <HTML> <body> <msup> <mfenced> <mi>a</mi> …