print the strings of printable characters in files
Project description
Installation
pip install pnu-strings
STRINGS(1)
NAME
strings - print the strings of printable characters in files
SYNOPSIS
strings [-a | --all] [-e encoding | --encoding=encoding] [-f | --print-file-name] [-h | --help | -? ] [-m number | -n number | --bytes=number | -number] [-o] [-s separator | --output-separator=separator] [-t radix | --radix=radix] [-v | -V | --version] [-w | --include-all-whitespace] [--debug] [--] [file ...]
DESCRIPTION
For each file specified, the strings utility prints contiguous sequences of printable characters that are at least n characters long and are followed by an unprintable character. The default value of n is 4. By default, the entire file is scanned. The strings utility is mainly used for determining the contents of non-text files.
If no file name is specified as an argument, standard input is read.
OPTIONS
The following options are available:
Options | Use |
---|---|
-a|--all | Scan the entire file for printable strings (which is the default anyway) |
-e encoding|--encoding=encoding | Select the character encoding to be used while searching for strings. Valid values for argument encoding are:
The default is to assume that characters are encoded using a single 7-bit byte |
-f|--print-file-name | Print the name of the file before each string |
-h|--help|-? | Print a usage summary and exit |
-m number|-n number|--bytes=number|-number | Print the contiguous character sequence of at least number characters long, instead of the default of 4 characters. Argument number should specify a positive decimal integer |
-o | Equivalent to specifying -t o |
-s separator|--output-separator=separator | By default, output strings are delimited by a new-line. This option allows you to supply any string separator to be used as the output record separator. Useful with --include-all-whitespace where strings may contain new-lines internally. |
-t radix|--radix=radix | Print the offset from the start of the file before each string using the specified radix. Valid values for argument radix are:
|
-v|-V|--version | Display a version identifier and exit |
-w|-include-all-whitespace | By default tab and space characters are included in the strings that are displayed, but other whitespace characters, such a new-lines and carriage returns, are not. The -w option changes this so that all whitespace characters are considered to be part of a string. |
--debug | Enable debug mode |
-- | Options processing terminator |
ENVIRONMENT
The STRINGS_DEBUG environment variable can be set to any value to enable debug mode.
The FLAVOUR or STRINGS_FLAVOUR environment variables can be set to one of the following values, to implement only the corresponding options and behaviours:
- posix : POSIX strings
- unix | unix:v10 : Unix v10 strings(1)
- bsd | bsd:freebsd : FreeBSD strings(1)
- gnu | gnu:linux | linux : GNU/Linux strings(1)
- plan9 : Plan 9 strings(1)
- inferno : Inferno strings(1)
However, if the POSIXLY_CORRECT environment variable is set to any value, then the POSIX flavour will be selected.
EXIT STATUS
The strings utility exits 0 on success, and >0 if an error occurs.
EXAMPLES
To display strings in all sections of /bin/ln use:
$ strings -a /bin/ln
To display strings in all sections of /bin/cat prefixed with the filename and the offset within the file use:
$ strings -a -f -t x /bin/cat
SEE ALSO
ar(1), nm(1), objdump(1), ranlib(1), readelf(1), size(1)
STANDARDS
The strings utility is a standard UNIX/POSIX command.
This re-implementation tries to follow the PEP 8 style guide for Python code.
Beyond Plan 9 and Inferno, UTF-encoded characters are supported in all (but POSIX and Unix v10) flavours with the -e u | --encoding=u options.
PORTABILITY
Tested OK under Windows.
HISTORY
The first strings utility was written by Bill Joy on April 22, 1978, and appeared in 2BSD.
This re-implementation was made for the PNU project.
LICENSE
It is available under the 3-clause BSD license.
AUTHORS
This manual page is based on the one written for FreeBSD by S.Sam Arun Raj samarunraj@gmail.com.
CAVEATS
This re-implementation does not support any executable format (ELF, a.out, COFF, etc.). All executable files are entirely scanned, regardless of -a | --all | - | --data | -d | -t | -s | -T | --target options.
GNU strings @file option is also unsupported.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pnu_strings-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 275d38b757b59ddfb632322527f00113e803feb1318da169bc7a5d80ef16372b |
|
MD5 | a379cb9368a64ff85815068e323ae850 |
|
BLAKE2b-256 | dfc4e0dfeeedea037ee90f600573c66d1bbb8b5da761a6bdd9e6bbb4c01457ef |