Friday, May 07, 2010

How to find a file in Linux operation system

One of the main problems that new Linux users have is to search for a perticular file or files. You can use find command for this in many ways.

Lets say you want to search for the file patch_24.sql in root directory.

find / -name patch_24.sql

If you want to search it from your current directory.

find ./ -name patch_24.sql

Lets say you want all the files start with patch.

find ./ -name patch*

If you need a search that do not consider the case sensitivity.

find ./ -iname patch*


Lets look in to some advance searches also.

If you want to look about files that bigger than 10000k

find ./ -size +10000

If the file size less than 500k

find ./ -size -500


So I guess you can have a good search now. Please refer man pages for more details.


~ Vidula Hasaranga - විදුල හසරංග ~