Skip to main content
added 3 characters in body; edited tags
Source Link
anki
  • 11.9k
  • 7
  • 35
  • 71

Under macOS Catalina 10.15.1, Using the standard "tree" command (as supplied by MacPorts), if at the Terminal prompt I cdcd to a folder and then execute "tree"theretree there, I get output like this:

.
├── Activity\ Monitor.app
├── ApplicationsFolderIcon.icns
├── BBEdit.app
├── Backup
│   ├── Backup\ and\ Sync\ from\ Google.app
│   ├── Carbon\ Copy\ Cloner.app
│   ├── Dropbox.app\ 
│   ├── ForeverSave\ 2.app
│   ├── Get\ Backup\ Pro\ 3.app

However, if I redirect the output to a text file, as in

tree > myapps.txt

then I get wrong characters when I view the file in TextEdit:

.
├── Activity\ Monitor.app
├── ApplicationsFolderIcon.icns
├── BBEdit.app
├── Backup
│   ├── Backup\ and\ Sync\ from\ Google.app
│   ├── Carbon\ Copy\ Cloner.app
│   ├── Dropbox.app\ 
│   ├── ForeverSave\ 2.app
│   ├── Get\ Backup\ Pro\ 3.app

What's wrong?

Under macOS Catalina 10.15.1, Using the standard "tree" command (as supplied by MacPorts), if at the Terminal prompt I cd to a folder and then execute "tree"there, I get output like this:

.
├── Activity\ Monitor.app
├── ApplicationsFolderIcon.icns
├── BBEdit.app
├── Backup
│   ├── Backup\ and\ Sync\ from\ Google.app
│   ├── Carbon\ Copy\ Cloner.app
│   ├── Dropbox.app\ 
│   ├── ForeverSave\ 2.app
│   ├── Get\ Backup\ Pro\ 3.app

However, if I redirect the output to a text file, as in

tree > myapps.txt

then I get wrong characters when I view the file in TextEdit:

.
├── Activity\ Monitor.app
├── ApplicationsFolderIcon.icns
├── BBEdit.app
├── Backup
│   ├── Backup\ and\ Sync\ from\ Google.app
│   ├── Carbon\ Copy\ Cloner.app
│   ├── Dropbox.app\ 
│   ├── ForeverSave\ 2.app
│   ├── Get\ Backup\ Pro\ 3.app

What's wrong?

Under macOS Catalina 10.15.1, Using the standard "tree" command (as supplied by MacPorts), if at the Terminal prompt I cd to a folder and then execute tree there, I get output like this:

.
├── Activity\ Monitor.app
├── ApplicationsFolderIcon.icns
├── BBEdit.app
├── Backup
│   ├── Backup\ and\ Sync\ from\ Google.app
│   ├── Carbon\ Copy\ Cloner.app
│   ├── Dropbox.app\ 
│   ├── ForeverSave\ 2.app
│   ├── Get\ Backup\ Pro\ 3.app

However, if I redirect the output to a text file, as in

tree > myapps.txt

then I get wrong characters when I view the file in TextEdit:

.
├── Activity\ Monitor.app
├── ApplicationsFolderIcon.icns
├── BBEdit.app
├── Backup
│   ├── Backup\ and\ Sync\ from\ Google.app
│   ├── Carbon\ Copy\ Cloner.app
│   ├── Dropbox.app\ 
│   ├── ForeverSave\ 2.app
│   ├── Get\ Backup\ Pro\ 3.app

What's wrong?

Source Link
murray
  • 165
  • 3
  • 14

Wrong line-drawing characters when write "tree" command output to file

Under macOS Catalina 10.15.1, Using the standard "tree" command (as supplied by MacPorts), if at the Terminal prompt I cd to a folder and then execute "tree"there, I get output like this:

.
├── Activity\ Monitor.app
├── ApplicationsFolderIcon.icns
├── BBEdit.app
├── Backup
│   ├── Backup\ and\ Sync\ from\ Google.app
│   ├── Carbon\ Copy\ Cloner.app
│   ├── Dropbox.app\ 
│   ├── ForeverSave\ 2.app
│   ├── Get\ Backup\ Pro\ 3.app

However, if I redirect the output to a text file, as in

tree > myapps.txt

then I get wrong characters when I view the file in TextEdit:

.
├── Activity\ Monitor.app
├── ApplicationsFolderIcon.icns
├── BBEdit.app
├── Backup
│   ├── Backup\ and\ Sync\ from\ Google.app
│   ├── Carbon\ Copy\ Cloner.app
│   ├── Dropbox.app\ 
│   ├── ForeverSave\ 2.app
│   ├── Get\ Backup\ Pro\ 3.app

What's wrong?