Skip to main content

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:
  • s for single 7-bit-byte characters (ASCII, ISO 8859).
  • S for single 8-bit-byte characters.
  • l for 16-bit little-endian.
  • b for 16-bit big-endian.
  • L for 32-bit little-endian.
  • B for 32-bit big-endian.
  • u for 1 to 4 bytes UTF-8 characters.

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:
  • d for decimal
  • o for octal
  • x for hexadecimal
-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:

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

Hubert Tournier

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

pnu_strings-1.0.1.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

pnu_strings-1.0.1-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file pnu_strings-1.0.1.tar.gz.

File metadata

  • Download URL: pnu_strings-1.0.1.tar.gz
  • Upload date:
  • Size: 13.6 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

Hashes for pnu_strings-1.0.1.tar.gz
Algorithm Hash digest
SHA256 8a258a1492638f7eaf73dd2b8416b554615106389d75894513efb97181a5447d
MD5 26c4e636c2297f45bee6d8bfaeeed2b5
BLAKE2b-256 8102d66779165e6cc8b3ed671b9681a29a96bec2a31e3dbb312f7e62433f4f1f

See more details on using hashes here.

File details

Details for the file pnu_strings-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pnu_strings-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.4 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

Hashes for pnu_strings-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 275d38b757b59ddfb632322527f00113e803feb1318da169bc7a5d80ef16372b
MD5 a379cb9368a64ff85815068e323ae850
BLAKE2b-256 dfc4e0dfeeedea037ee90f600573c66d1bbb8b5da761a6bdd9e6bbb4c01457ef

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page