Extract printable strings from a file. The usual use is to look inside some data or program file to get possibly useful information out of it. It's also useful if you have a file that MIGHT contain garbage control characters and you just want to be safe.
Without any flags, strings doesn't necessarily search the entire file:
apl$ strings -15 `which strings` | wc -l 207 apl$ strings -a -15 `which strings` | wc -l 208 apl$ strings - -15 `which strings` | wc -l 242
But on a Linux box:
bash-2.05a$ strings -15 `which strings` | wc -l 47 bash-2.05a$ strings -a -15 `which strings` | wc -l 47 bash-2.05a$ strings - -15 `which strings` | wc -l 47
And on a BSD box, "-" and "-a" are equivalent:
bash-2.05a$ strings -15 `which strings` | wc -l 117 bash-2.05a$ strings -a -15 `which strings` | wc -l 172 bash-2.05a$ strings - -15 `which strings` | wc -l 172
Got something to add? Send me email.
More Articles by Tony Lawrence © 2011-07-07 Tony Lawrence
The best of us would rather be popular than right. (Mark Twain)
Printer Friendly Version
strings Copyright © December 2003 Tony Lawrence
Have you tried Searching this site?
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.
Contact us
Printer Friendly Version