linux命令strings

linux命令strings,其man信息如下:
strings(1)                                        GNU Development Tools                                        strings(1)

NAME
       strings - 显示文件中的可打印字符

总览 (SYNOPSIS)
       strings
              [-a|-|--all] [-f|--print-file-name] [-o] [--help] [-v|--version] [-n min-len|-min-len|--bytes=min-len] [-t
              {o,x,d}[--target=bfdname] |--radix={o,x,d}] file

描述 (DESCRIPTION)
       For each file given, GNU strings 显示 每个 指定的 file 文件里 包含的 所有 有 4个 (或者 用 选项 指定 的 数字) 以 上
       连 续 可打印 字符 的字符串, 在 之后 紧跟着 一个 不可 打印 的 字符. 默认 情况 下, 它 只显示 目标文件 初始化 和 装载
       段 的 字符串; 对于 其它 类型 的 文件 它 显示 整个 文件 里包含 的 所有 字符串.

       strings 一般 用来 查看 非 文本 文件 的 内容.

选项 (OPTIONS)
       在 这里 并列 的 长选项 和 短选项 都是 等价的.

       -a

       --all

       -      不 只是 扫描 目标 文件 初始化 和 装载 段, 而是 扫描 整个 文件.

       -f

       --print-file-name
              在 显示 字符串 之前 先 显示 文件名.

       --help 在 标准 输出 打印 strings 命令 的 选项

              列表

              然后 退出.
   -v

       --version
              在 标准 输出 打印 strings 命令 的 版本号 然后 退出.

       -n min-len

       -min-len

       -bytes=min-len
              打印 至少 min-len 字符 长 的 字符串. 默认的 是 4.

       -t {o,x,d}

       --radix={o,x,d}
              在 字符串 前面 显示 其在 文件 中 的 偏移量. 选项 中 的 单个 字符 指定 偏移量的 进制 是 八进制, 十六进制 还
              是 十进制.

       --target=bfdname
              指定 一种 目标 代码 格式 来 代替 你的 系统的 默认 格式. 关于 可用的 目标 代码格式 请 参见 objdump(1).

       -o     同 -t o.

------------------------------

strings - print the strings of printable characters in files.

       For each file given, GNU strings prints the printable character sequences that are at
       least 4 characters long (or the number given with the options below) and are followed by
       an unprintable character.   By default, it only prints the strings from the initialized
       and loaded sections of object files; for other types of files, it prints the strings from
       the whole file.
       strings is mainly useful for determining the contents of non-text files.


可见strings能输出文件中的可打印字符串(可指定字符串的最小长度),通常用来查看非文本文件(如二进制可执行文件)中的可读内容。比如:

[yixbao.cn]#strings /lib/tls/libc.so.6 | grep GLIBC
GLIBC_2.0
GLIBC_2.1
GLIBC_2.1.1
GLIBC_2.1.2
GLIBC_2.1.3
GLIBC_2.2
GLIBC_2.2.1
GLIBC_2.2.2
GLIBC_2.2.3
GLIBC_2.2.4
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_PRIVATE

这样就能看到glibc支持的版本。

http://www.cppblog.com/prayer/archive/2009/07/22/90836.html


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值