Search This Blog

Tuesday, February 15, 2011

linux find command

1  find . -name "*.c" | xargs grep 'back'
Find the key word "back" in all .c files under the present directory.
pay special attention to the blanks between:
"find" and ".";
"." and "-name";
"-name" and " "*.c" ";
" "*.c" " and "|";
and so on.


2 find . -name "*" | xargs grep 'cudaSetDevice'
Find the key word "cudaSetDevice" under the present directory and all its subdirectories.