uTools-Manuals/docs/linux/strings.html
2019-04-21 11:50:48 +08:00

25 lines
1.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1 id="strings">strings</h1>
<p>在对象文件或二进制文件中查找可打印的字符串</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>strings命令</strong> 在对象文件或二进制文件中查找可打印的字符串。字符串是4个或更多可打印字符的任意序列以换行符或空字符结束。 strings命令对识别随机对象文件很有用。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">strings [ -a ] [ - ] [ -o ] [ -t Format ] [ -n Number ] [ -Number ] [file ... ]</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">-a --all扫描整个文件而不是只扫描目标文件初始化和装载段
-f print-file-name在显示字符串前先显示文件名
-n bytes=[number]找到并且输出所有NUL终止符序列
- 设置显示的最少的字符数默认是4个字符
-t --radix={o,d,x} :输出字符的位置,基于八进制,十进制或者十六进制
-o :类似--radix=o
-T --target= :指定二进制文件格式
-e --encoding={s,S,b,l,B,L} :选择字符大小和排列顺序:s = 7-bit, S = 8-bit, {b,l} = 16-bit, {B,L} = 32-bit
@ :读取中选项</code></pre>
<h3 id="实例">实例</h3>
<p>列出ls中所有的ASCII文本</p>
<pre><code class="language-bash">strings /bin/ls</code></pre>
<p>列出ls中所有的ASCII文本</p>
<pre><code class="language-bash">cat /bin/ls strings</code></pre>
<p>查找ls中包含libc的字符串不区分大小写</p>
<pre><code class="language-bash">strings /bin/ls | grep -i libc</code></pre>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->