Javatpoint Logo
Javatpoint Logo

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'.

Example:

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

Example:

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.

Example:

Linux Find3

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

Next TopicLinux Locate




Please Share

facebook twitter google plus pinterest

B.Tech / MCA


Learn Latest Tutorials