例如,mysql
命令
mysql -e 'show databases'
+--------------------------+
| Database |
+--------------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------------+
但是当你重定向到一个文件时,内容是不同的,例如
mysql -e 'show databases' > /tmp/test.txt
cat /tmp/test.txt
Database
mysql
performance_schema