Finding files in Linux filesystems

by on February 11, 2006 · 3 comments· last updated at January 31, 2007

Both Linux and Unixish provides command to find file. The best and easy way to find file is to use command called locate. It list files in databases that match a pattern. For example to find file called myprog.c you need to use locate command as follows:

$ locate myprog.c | less

Another option is to use find command. For example find out all C source code file from /home/jerry directory:
$ find /home/jerry -name "*.c" -print
OR
$ find ~jerry -name "*.c" -print
Please note that ~jerry is short-cut name to refer user jerry's home directory (/home/jerry). FIND command has very advance usage please see following articles for more information:



You should follow me on twitter here or grab rss feed to keep track of new changes.

Featured Articles:

{ 2 comments… read them below or add one }

1 NickJ October 5, 2006 at 5:31 am

How do I take a backup of a file which is continuously written by an application. And if the application not able to write in that file it will get crashed. I dont want to crashed the application.
Also, the file size is around 700MB to 1GB.
Please advice..

Reply

2 nixcraft October 5, 2006 at 12:13 pm

NickJ,

USE LVM based backup, see following url for Logical Volume Manager snapshot to avoid inconsistent backup

http://www.cyberciti.biz/tips/consistent-backup-linux-logical-volume-manager-snapshots.html

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <kbd> <blockquote> <pre> <a href="" title="">

Tagged as:

Previous Faq:

Next Faq: