PeterVandivier
I would like to dump a man page to a text file so I can open it in a text editor and keep working in this terminal session uninterrupted. Easy enough, right?
```bash
man ps > ps.txt
```
![Screenshot 2020-12-08 at 15.40.05.png](/image?hash=121abeadfe27f1b125badd73f96ca9246d55579b304c49c189228dbbe6e550ba)
What the heck?! What's all this junk?! It doesn't show up when I use `cat` or `head` on the file?
![Screenshot 2020-12-08 at 15.42.06.png](/image?hash=f286f253a193700e7e6bad7574acb6300bcfb412eaa617543dd02adb2d5cdf02)
It appears to correspond to the characters that are **bold** on the `man` terminal output...
![Screenshot 2020-12-09 at 15.54.32.png](/image?hash=0a87b8644d8ba881a79564a80ea79558514eaa1baf5f551d04de9f3b120e3a8c)
My text editor ([sublime text 3](https://www.sublimetext.com/3)) is showing 0x08 - which happens to be the [ascii control character](https://www.asciitable.com/index/asciifull.gif) for delete - and sure enough [selecting all instances](https://stackoverflow.com/a/12162136/4709762)^⌘+ctrl+g^ of the errant sequence then hitting backspace twice fixes my file. As well, piping the file into xxd confirms character `08` in the respective locations.
```text
1209 15:57:42+0000 [Desktop] $ cat ps.txt | xxd | head
00000000: 0a50 5328 3129 2020 2020 2020 2020 2020 .PS(1)
00000010: 2020 2020 2020 2020 2020 2042 5344 2047 BSD G
00000020: 656e 6572 616c 2043 6f6d 6d61 6e64 7320 eneral Commands
00000030: 4d61 6e75 616c 2020 2020 2020 2020 2020 Manual
00000040: 2020 2020 2020 2020 2020 5053 2831 290a PS(1).
00000050: 0a4e 084e 4108 414d 084d 4508 450a 2020 .N.NA.AM.ME.E.
00000060: 2020 2070 0870 7308 7320 2d2d 2070 726f p.ps.s -- pro
00000070: 6365 7373 2073 7461 7475 730a 0a53 0853 cess status..S.S
00000080: 5908 594e 084e 4f08 4f50 0850 5308 5349 Y.YN.NO.OP.PS.SI
00000090: 0849 5308 530a 2020 2020 2070 0870 7308 .IS.S. p.ps.
1209 15:57:50+0000 [Desktop] $
```
What's going on here? Why is this garbage in my file and how can I clean it out in a more sensible way?
---
Note - this behaviour does not recur on linux. It does occur on FreeBSD (not all that surprising though, given the header in my MacOS man page).