find "path name" -name "file name" -exec grep -H "search content" {} \;

find原本是用「檔案名稱」來搜尋在哪些地方有這些檔案,將這些路徑結果餵給grep後,就可以拿來搜尋檔案內部的文字片段。

Ex:
find ./kernel -name "*.c" -exec grep -H "main" {} \;
以上這段指令,是要搜尋./kernel底下所有的.c檔,內容含有"main"的地方。

find的參數:
  -name 要搜尋哪些檔名
  -exec utility name [argument...] {} \;
    搜尋出的檔名 交給哪個執行檔(utility name)處理
    {} 會被find搜尋後的檔名路徑名稱所取代
    \; 代表exec的參數到此為止

grep的參數:
  -H 列出搜尋到的檔案名稱路徑

來自大海的心 發表在 痞客邦 留言(0) 人氣()

Vi: Search and Replace
Change to normal mode with <ESC>.
Search (Wraped around at end of file):

來自大海的心 發表在 痞客邦 留言(0) 人氣()

參考網址:http://falldog7.blogspot.com/2008/01/linux.html


find "path name" -name "file name" -exec grep -H "search content" {} \;
find原本是用「檔案名稱」來搜尋在哪些地方有這些檔案,將這些路徑結果餵給grep後,就可以拿來搜尋檔案內部的文字片段。
Ex:
find ./kernel -name "*.c" -exec grep -H "main" {} \;
以上這段指令,是要搜尋./kernel底下所有的.c檔,內容含有"main"的地方。
find的參數:
  -name 要搜尋哪些檔名
  -exec utility name [argument...] {} \;
    搜尋出的檔名 交給哪個執行檔(utility name)處理
    {} 會被find搜尋後的檔名路徑名稱所取代
    \; 代表exec的參數到此為止
grep的參數:
  -H 列出搜尋到的檔案名稱路徑

來自大海的心 發表在 痞客邦 留言(0) 人氣()

vmware_ssh
使用ESXi 4.x時,若是要建立thick disk(多台VM可以共用的disk)時,之前查詢到的做法,
是要依照以下方式去處理:
1.Go to the ESXi console and press alt+F1
2.Type: unsupported
3.Enter the root password(No prompt, typing is blindly)
4.At the prompt type “vi /etc/inetd.conf”
5.Look for the line that starts with “#ssh” (you can search with pressing “/”)
6.Remove the “#” (press the “x” if the cursor is on the character)
7.Save “/etc/inetd.conf” by typing “:wq!”
8.Restart the management service “/sbin/services.sh restart”
在這中間,有一個重點,那就是第1點的,Go to the ESXi console ...,要到主機面前去
假如主機不在附近,或不方便去機房的話,就無法設定了?

來自大海的心 發表在 痞客邦 留言(0) 人氣()

在Linux上,安裝了mutt、設定sendmail並且啟動服務之後,要以mutt寄mail時,
出現無法寄送訊息的錯誤。
$ /opt/mutt-1.5.12/mutt -s "TEST subject" -e 'my_hdr from:admin<conbar@iserious.com>' -a test.log "conbar<conbar@iserious.com>" < test.log
Error sending message, child exited 127 (Exec error.).
Could not send the message.

來自大海的心 發表在 痞客邦 留言(0) 人氣()

在Client端以SSH連線到主機時,會要求產生認證資訊,儲存在client端的~/.ssh/known_ssh檔中。
如果有連線到多台不同主機,known_hosts裡面就會記錄許多記錄。
 
但是,假如server被重灌了,這樣子新的server就和known_hosts裡的狀態不同,
再連線時,就會出現底下錯誤:

來自大海的心 發表在 痞客邦 留言(0) 人氣()

1
Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。