Wednesday, July 28, 2010

How to search or find files in Linux OS

1, find
find everything you want to find
find /etc -name "*in*" -ls
2, whereis
used to find the program
whereis grep
-b binary -m man -s source
whereis -b grep
3, grep
find the content in the file, not used to find file itself
grep abc file1
4, locate
equals to "find -name", but faster than latter
locate /etc/sh find all files start with sh in /etc
locatedb is in /var/lib/locatedb
updatedb
5, which
find where the command is in of the PATH envirment
which find
6, type
not used for find,  used to talk the command is build in or outer
type cd
but type -p cd will show the path of the cd command

------------------------
Kind Regards,
Yonggang Meng

0 comments:

Post a Comment