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.
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
File details
Details for the file pnu_strings-1.0.0.tar.gz
.
File metadata
- Download URL: pnu_strings-1.0.0.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3a5313ecd49a59920be4a2118981aa06cc3de2d4c6f4f41c2e587964ff120cf |
|
MD5 | 3e60f9db892eeffb93ce8621d37bc003 |
|
BLAKE2b-256 | f478f17bdb448171544919f7316faf02af7172b8535e0d8148e432842b7ac693 |
File details
Details for the file pnu_strings-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: pnu_strings-1.0.0-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d60907623df86ec4498892f25d6076c866b0cbb010ec4bc85f57d5a5e6fd3861 |
|
MD5 | 7f09faa00a2ed21faba084e6705f40a5 |
|
BLAKE2b-256 | 526ec1792d5b6bc0e88c3054b5344dae9c30e583baa4844b59bd3fb1d85b2a38 |