Skip to main content
deleted 156 characters in body
Source Link
harrymc
  • 1
  • 31
  • 579
  • 995

The promptRedirecting will result in a file that is not part of either stdout or stderr which are the onlydifficult to read things you can redirect. This is on purpose,(or use) because of the binary characters in almost all cases, when you redirect bash's output you don't want the prompt.

UseFor getting a readable complete copy of your session, you could use script(1) to log everything sent to the terminal:

$ script
Script started, file is typescript
$ # do your work
...
$ # then exit with ^D
$ exit
Script done, file is typescript

The prompt is not part of either stdout or stderr which are the only things you can redirect. This is on purpose, because in almost all cases, when you redirect bash's output you don't want the prompt.

Use script(1) to log everything sent to the terminal:

$ script
Script started, file is typescript
$ # do your work
...
$ # then exit with ^D
$ exit
Script done, file is typescript

Redirecting will result in a file that is difficult to read (or use) because of the binary characters in the prompt.

For getting a readable complete copy of your session, you could use script(1) to log everything sent to the terminal:

$ script
Script started, file is typescript
$ # do your work
...
$ # then exit with ^D
$ exit
Script done, file is typescript
Source Link
harrymc
  • 1
  • 31
  • 579
  • 995

The prompt is not part of either stdout or stderr which are the only things you can redirect. This is on purpose, because in almost all cases, when you redirect bash's output you don't want the prompt.

Use script(1) to log everything sent to the terminal:

$ script
Script started, file is typescript
$ # do your work
...
$ # then exit with ^D
$ exit
Script done, file is typescript