简体   繁体   中英

Redirecting output of terminal to file

I'm trying to redirect the output of a command from a terminal to a text file. My command is:

rails_best_practices . > rbp.txt

It works fine but the contents of the file is a bit different.

[1;31m/Users/carlwilliamtablante/www/serviceseeking/db/schema.rb:16 - always add db index (abns => [provider_account_id])[0m

在此处输入图片说明

As you can see in the screenshot, it outputs an ESC character, but when trying to view it on the reminal using cat , it should display the line number. So how do I fix this?

https://github.com/railsbp/rails_best_practices中 :您可以使用--without-color来省略颜色代码。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM