您的位置:首页 > 其它

vim gdb misc

2015-10-14 13:20 375 查看

1 e.g.

grep -l "ERROR:" *.log

to recursively search in a directory is as,

grep -r "LOG" *

where -r means recursively, * means match any file in current directory,

2

Q:

I have a small program, test.c. It runs OK. This is on Linux (kernel

2.6.8.1, GCC 3.4.1).

I decided to convert it to C++ before expanding it to a larger program. I

changed the filename to test.cpp and added

extern "C" {

}

around main and all the non-static subroutines. It compiles OK, but when I

link it, it says:

test.o (.eh_frame+0x11): undefined reference to '__gxx_personality_v0'

A:

use g++ to link

3

in vim, there's a xxd as an external program.

vim foo

:%!xxd

4

An exam from TLCL handbook (where TLCL= The Linux Command Line)

[me@linuxbox ~]$ diff -c file1.txt file2.txt

*** file1.txt 2008-12-23 06:40:13.000000000 -0500

--- file2.txt 2008-12-23 06:40:34.000000000 -0500

***************

*** 1,4 ****

- a

b

c

d

--- 1,4 ----

b

c

d

+ e

5 MPEG PES has been supported in wireshark

But the packet is inside UDP, not support that inside TCP.

There are also MPEG PES sample in wireshark official site.

6 gdb

x /16xb 0x8ae64de

16=length of memory

x = format, like printf(format)

b = binary

the result is as

0x47    0x00    0x11    0x17    0x1d    0x01    0xbb    0x01

7 vim how to search

1 search a word "word", use:/word, when found, use "n" or "N" or "3N" to go to next/previous one

2 search a word "word" ignore the case, use

:set ignorecase

/word

to set back, use

:set noignorecase
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: