iT邦幫忙

0

linux terminal 訊息存成檔案

leo226 2012-10-15 00:22:1219628 瀏覽

請問linux 下用find尋找要如何將list出來的清單匯成一個檔案呢?
例如windows下可以用dir > test.txt的方式將cmd下的訊息存成txt檔,在linux下要如何操作呢?

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中
6
SunAllen
iT邦研究生 1 級 ‧ 2012-10-15 00:58:57

方法和Windows 差不多

<pre class="c" name="code">
find / | grep hosts > hosts.log

或是
[code]
find / | grep hosts >> hosts.log
[code]

6
Blue Jacky
iT邦大師 1 級 ‧ 2012-10-15 01:01:23

其實大同小異
依你舉的例子

在 Windows 下
dir > test.txt

在 Linux 下
ls > test.txt

2
hon2006
iT邦大師 1 級 ‧ 2012-10-15 09:32:40

請問大大是要分析那一種log檔
可以參考鳥哥的網頁
http://linux.vbird.org/linux_basic/0570syslog/0570syslog.php
http://linux.vbird.org/download/

我要發表回答

立即登入回答