ltrace

File Read

The file is parsed as a configuration file and its content is shown as error messages.

ltrace -F /path/to/input-file /dev/null

File Write

The data to be written appears amid the library function call log, quoted and with special characters escaped in octal notation. The string representation will be truncated, pick a value big enough instead of `999`. More generally, any binary that executes whatever library function call passing arbitrary data can be used in place of `ltrace -F DATA`.

ltrace -s 999 -o /path/to/input-file ltrace -F DATA

Shell

ltrace -b -L /bin/sh