rails - Redirecting console output to a file

前端 未结 7 832
时光取名叫无心
时光取名叫无心 2020-12-12 09:51

On a bash console, if I do this:

cd mydir
ls -l > mydir.txt

The > operator captures the standard input and redirects it to a file; so I

7条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-12 10:25

    Apart from Veger's answer, there is one of more way to do it which also provides many other additional options.

    Just open your rails project directory and enter the command:

    rails c | tee output.txt
    

    tee command also has many other options which you can check out by:

    man tee
    

提交回复
热议问题