精華區beta NTUWindBand 關於我們 聯絡資訊
※ 引述《stevel (朝九晚五之睡覺族)》之銘言: : : % find S_DIR -name FILENAME 2> /dev/null : : 其中,S_DIR是search directory(default / directory),FILENAME是target file. : : 我要如何能直接在prompt 下鍵入: : : % f FILENAME S_DIR : : shell就會自動的執行我要的動作呢? (Note: S_DIR 是 optional, 可不提供). : 聽說,大概只有 csh, tcsh 那一派的, alias 才能傳遞參數。 : 底下,引出一段 bash 的 document: : There is no mechanism for using arguments in the replacement text, : as in `csh'. If arguments are needed, a shell function should be used. : 所以,唯一的方法,大概就是用 function 。 還有一個方法啊.....在Unix下去執行 ls -alR 就可以列出所有子目錄下的所有 檔案....如果你要指定看某個子目錄的檔案時..在Unix下執行 ls -alR |grep X ....其中的X為你所指定的子目錄(subdirectory)...例如你要看Mail下的檔案.. 就打 ls -alR |grep Mail 即可.....就醬子.... -- ※ 發信站: 批踢踢實業坊(ptt.m8.ntu.edu.tw) ◆ From: ccsun1.csie.nct