find: find file or folder, and search a specific word

(1) find all of files which includes “.pl” at present directory.

find -name ‘*.pl’

(2) find all of files which includes “*.pl” at whole directories

find / -name ‘*.pl’

(3) find all of files which starts with “ab*” at whole directories

find / -name ‘ab*’

(4) find all of files which includes “*.pl*” at whole directories, and print as “ls” type.

find / -name ‘*.pl’ -ls

(5) find directory : -type d

find / -name ‘temp*’ -type d

————————————————–

(6) search a specific word at all directories

find / xargs grep “hello”

(7) search a specific word at specific files or more

find / *.txt | xargs grep “hello”

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s