linux命令之strings

來源:互聯網
上載者:User

linux命令之strings

strings 命令是在對象檔案或二進位檔案中尋找可列印的字串。字串是4個或者更多可列印字串的任意序列,以分行符號或者Null 字元結束。

strings文法
strings [options] file_name

options:
-a / -all : 掃描整個檔案而不是只掃描目標檔案初始化和裝載段。
-f / -print-file-name:在顯示字串前顯示檔案名稱
-n / -bytes=[number]:找到並且輸出說有NULL終止符序列
- num :設定顯示的最少字元數(num是一個數字),預設是4個字元
-t {o,d,x}/-radix={o,d,x} :輸出字元的位置,基於八進位,十進位或者十六進位。
-o :類似-radix=o
-T /-target= : 指定二進位檔案格式
@:從檔案中讀取選項

樣本:

$ gcc hello.c -o hello$ strings hello/lib/ld-linux.so.2__gmon_start__libc.so.6_IO_stdin_usedprintf__libc_start_mainGLIBC_2.0PTRhUWVS[^_];*2$"
$ cat test -f-t d$ strings @test hellohello: 340 /lib/ld-linux.so.2hello: 541 __gmon_start__hello: 556 libc.so.6hello: 566 _IO_stdin_usedhello: 581 printfhello: 588 __libc_start_mainhello: 606 GLIBC_2.0hello: 824 PTRhhello: 1040 UWVShello: 1132 [^_]hello: 1359 ;*2$"

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.