Excerpt from: http://blog.csdn.net/stpeace/article/details/46641069
Introduction to Strings commands in Linux
Before we talked about the use and use of Linux strings, but as far as I know, there are some friends are not used strings, this is a bad habit. So, this article continues to wordy the strings command.
In software development, we often need to modify the code, and generate static libraries, dynamic libraries or executables, sometimes, the project is too large, how to determine the correct code to compile into the library? Use the strings command! For simplicity, let's just take an executable file as an example:
- #include <iostream>
- using namespace std ;
- &NBSP;&NBSP;
- int main ()
- {
- cout << Hello world << endl;
- &NBSP;&NBSP;&NBSP;&NBSP;RETURN&NBSP;0;&NBSP;&NBSP;
- }
- [[EMAIL&NBSP;PROTECTED]&NBSP;TEST]$&NBSP;G++&NBSP;TEST.CPP&NBSP;&NBSP;&NBSP;
- [[email protected] test]$ strings a.out | grep main
- __LIBC_START_MAIN&NBSP;&NBSP;
- [[Email protected] test]$ strings a.out | grep hello
- HELLO&NBSP;WORLD&NBSP;&NBSP;
- [email protected] test]$
As can be seen, the Test.cpp file was compiled into the a.out file. In the actual development, we often need to use the strings command to confirm and verify, to ensure foolproof. Sometimes, your changes are not wrong, but the actual is not compiled into the library, and therefore can not be effective, puzzled for a long time, misleading.
I almost have to use the strings command every day, so I fell in love with strings.
For more information on strings, I enclose the address of the previous article: http://blog.csdn.net/stpeace/article/details/46641069
Introduction to Strings commands in Linux 2