1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:07:34 +00:00

strings: Replace the -p option with the more commonly used -f

Previously, the `-p` option printed the path of the file being
processed before any strings for that file. The `-f` prints the file
path before each string . This matches the behavior of strings on
Linux and FreeBSD.
This commit is contained in:
Tim Ledbetter 2023-06-20 18:06:20 +01:00 committed by Andreas Kling
parent 3de4cd0ba9
commit ab1e8a7b91
2 changed files with 7 additions and 9 deletions

View file

@ -5,7 +5,7 @@ strings - find printable strings in files
## Synopsis
```**sh
$ strings [-n NUMBER] [-p] [-t FORMAT] [PATHS...]
$ strings [-n NUMBER] [--print-file-name] [-t FORMAT] [PATHS...]
```
## Description
@ -15,7 +15,7 @@ $ strings [-n NUMBER] [-p] [-t FORMAT] [PATHS...]
## Options
* `-n NUMBER`: Specify the minimum string length (4 is default).
* `-p`: Write the pathname for each file specified in `PATHS` to standard output.
* `-f`, `--print-file-name`: Print the name of the file before each string.
* `-t FORMAT`: Write each string preceded by its byte offset from the start of the file in the specified `FORMAT`, where `FORMAT` matches one of the following: `d` (decimal), `o` (octal), or `x` (hexidecimal).
## Examples
@ -35,5 +35,5 @@ $ strings -t x ~/Videos/test.webm
Display the printable strings in all .txt files in the current directory, preceded by their pathname:
```sh
$ strings -p *.txt
$ strings -f *.txt
```