About Linux FAQ

Browse More FAQs:

Finding files in Linux filesystems

Posted by Vivek Gite [Last updated: 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:

Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

Related Other Helpful FAQs:

Discussion on This FAQ

  1. Linux: How can I find a file on my system? | Frequently Asked Questions Says:

    [...] See this previous article for more info. [...]

  2. NickJ Says:

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

  3. nixcraft Says:

    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

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.