Linux find

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

Linux find

The find command help us to find a particular file wihtin a directory. It is also used to find a list of files having same pattern name.

After find command we may use following symbols:

(.) : For current directory name

(/) : For root

Finding By Name

You can search all the files ending with extension '.txt'.


  1. find . -name "*.txt"  

Linux Find1

Look at the above snapshot, all the files ending with '.txt' are listed with find command.

Finding By Type

The '-type' parameter is used to specify the file type.

Some of the file types are:

f: regular file

d: directory

l:symbolic links

c: character devices

b: block devices


  1. find . -type d -name "*.bak"  

Linux Find2

Look at the above snapshot, command (find . -type d -name "*.bak") displays all the directories ending with '.bak'.

Finding Newer Files

The '-newer' parameter helps in searching the files which are newer than the mentioned file.


find . -type d -name ?*.bak? 

Linux Find3

Look at the above snapshot, all the files displayed are newer than 'msg.txt' file.