字符>(或>>)可與Windows中的命令一起使用,以將命令的結果記錄到文件中。 Linux有這種能力嗎?你怎麼做呢?是否存在與Windows> log.txt相同的Linux日誌命令輸出到文件?
例: $找到/?>find.txt
此命令將使當前目錄find.txt命名的文件。此文件將包含究竟是什麼在詞窗口中鍵入命令後:
Searches for a text string in a file or files.
FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]filename[ ...]]
/V Displays all lines NOT containing the specified string.
/C Displays only the count of lines containing the string.
/N Displays line numbers with the displayed lines.
/I Ignores the case of characters when searching for the string.
/OFF[LINE] Do not skip files with offline attribute set.
"string" Specifies the text string to find.
[drive:][path]filename
Specifies a file or files to search.
If a path is not specified, FIND searches the text typed at the prompt
or piped from another command.
一個有趣的功能是null功能。在Windows上:'echo「hello world」> NUL'和Linux:'echo「hello world」>/dev/null' – jyz 2010-09-24 03:51:26