Finding files by matching patterns

The simplest way to find files is with GNU locate. Use it when you want to list all files on the system whose full path name matches a particular pattern−−for example, all files with the text `audio' somewhere in their full path name, or all files ending with `ogg'; locate outputs a list of all files on the system that match the pattern, giving their full path name. When specifying a pattern, you can use any of the file name expansion characters

To find all the files on the system that have the text `audio' anywhere in their name, type:

$ locate audio RET

To find all the files on the system whose file names end with the text `ogg', type:

$ locate *ogg RET

To find all hidden "dotfiles" on the system, type:

$ locate /. RET

NOTE:locate searches are not case sensitive and you should have run updatedb before searching in order to update the search database.

Posted on: 16/12/2009

If you want to leave a comment please Login or Register
How to backup your data using rsync......
Understanding autoconf......
The Basics of fdisk......
Accessing Memory Using DMA......
The fd Directory......