zoukankan      html  css  js  c++  java
  • linux中的strings命令简介2

    摘自:http://blog.csdn.net/stpeace/article/details/46641069

    linux中的strings命令简介

    之前我们聊过linux strings的用法和用途, 但据我了解, 还有部分朋友并不常用strings, 这是个不好的习惯。 所以, 本文继续啰嗦一下strings命令.

            在软件开发中, 我们经常需要修改代码, 并生成静态库、动态库或者可执行文件, 有时候, 工程太大, 那怎样确定自己改动的代码正确编译到库中去了呢? 用strings命令吧!  为了简便起见, 我们仅仅以可执行文件为例:

    1. #include <iostream>  
    2. using namespace std;  
    3.   
    4. int main()  
    5. {  
    6.     cout << "hello world" << endl;  
    7.     return 0;  
    8. }  
    9. [taoge@localhost test]$ g++ test.cpp   
    10. [taoge@localhost test]$ strings a.out | grep main  
    11. __libc_start_main  
    12. [taoge@localhost test]$ strings a.out | grep hello  
    13. hello world  
    14. [taoge@localhost test]$   

           可见,test.cpp文件是编译进了a.out文件的。 在实际开发中, 我们经常需要用strings命令进行确认和验证, 确保万无一失。 有些时候, 你的修改并没有错, 但实际并没有编译到库中, 因此不能生效, 纳闷良久, 误导人很长时间的。 

           我每天几乎都要用strings命令, 所以慢慢就爱上了strings.

          

           为了便于了解更多关于strings的内容, 我附上之前文章的地址:http://blog.csdn.net/stpeace/article/details/46641069

  • 相关阅读:
    Curl Get请求&漏参数
    【Java基础】日期操作(返回当前日期&日期比较)
    【Java基础】生产者消费者模式
    [Groovy] 在Groovy中优雅的实现do while
    【转载】时间复杂度的度量
    [转载]Spring Cloud初探
    [Maven] 使用Maven管理多模块项目
    JS基础三
    JS基础部分(二)
    笔记不详细记录了,学完css之后做出下面分布的导航页
  • 原文地址:https://www.cnblogs.com/LiuYanYGZ/p/5574597.html
Copyright © 2011-2022 走看看