Introduction to Strings commands in Linux 2

Source: Internet
Author: User

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:

    1. #include  <iostream>  
    2. using namespace std ;   
    3. &NBSP;&NBSP;
    4. int main ()   
    5. {   
    6.     cout <<  Hello world  << endl;   
    7. &NBSP;&NBSP;&NBSP;&NBSP;RETURN&NBSP;0;&NBSP;&NBSP;
    8. }  
    9. [[EMAIL&NBSP;PROTECTED]&NBSP;TEST]$&NBSP;G++&NBSP;TEST.CPP&NBSP;&NBSP;&NBSP;
    10. [[email protected] test]$ strings a.out | grep main  
    11. __LIBC_START_MAIN&NBSP;&NBSP;
    12. [[Email protected] test]$ strings a.out  | grep hello  
    13. HELLO&NBSP;WORLD&NBSP;&NBSP;
    14. [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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.