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

linux中的strings命令简介

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

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

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

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

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

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

最新文章

  1. Windows下memcached.exe的安装与配置
  2. POJ 2251 BFS(简单)
  3. SVN hooks强制提交时填写日志
  4. 将svn添加到系统服务
  5. m版页面判断安卓与ios系统
  6. oo面向对象原则
  7. DirectX 初始化DirectX(第一方式)
  8. Mybatis自己主动生成代码
  9. React.js入门笔记 创建hello world 的6种方式
  10. 类xml数据格式解析
  11. python基础---pymsql
  12. python基础(初识Python)
  13. mooc- 基本程序设计方法week1,week2
  14. cannot import name &#39;_imaging&#39; 与No module named PIL解决方法
  15. Java io使用简介
  16. Tensorflow之基于LSTM神经网络写唐诗
  17. POJ 2352 Stars【树状数组】
  18. samba服务配置(一)
  19. Ubuntu 服务器指南
  20. 字符串、字节数组、流之间的相互转换以及文件MD5的计算

热门文章

  1. button元素兼容问题浅析
  2. code 代码分析 及其解决方案
  3. Types of Binary Tree
  4. 徐汉彬:亿级Web系统搭建—单机到分布式集群
  5. hibernate Restrictions用法
  6. 一起talk GDB吧(第七回:GDB监视功能)
  7. UBUNTU系统root帐号解锁
  8. android 获取屏幕尺寸
  9. 测试 windows live writer
  10. C#调用SAPWebService