UNIX/Linux: Easily Find or Search Files or Directories

If you are new to Linux, you may find shortcuts like this one helpful. This tutorial explains how to find a file or directory from the command line.

    Note: This is the UNIX version of DOS’s dir/s.

    When searching for a file or folder, you can use the following commands:

    To search the current directory and all subdirectories for a folder or file, use the following command:

    find . -name filename

      – where “filename” is the file or folder for which you are looking

    To search one directory and all its subdirectories, use the following command:

    find foldername -name filename

      – where “filename” is the file or folder for which you are looking and “foldername” is the folder in which you want to search

The Conversation

Follow the reactions below and share your own thoughts.

3 Responses to “UNIX/Linux: Easily Find or Search Files or Directories”

  1. February 02, 2009 at 5:38 am, Dennis Quek said:

    Oh god thanks… this is so much clearer than other sites.. some examples will be good.

    Reply

  2. September 22, 2009 at 4:12 pm, Arjun said:

    Thanks – top tip :)

    Reply

  3. February 11, 2010 at 4:58 pm, Anonymous said:

    All the help I see is to search for files. What if I want to search a file or multiple files for a value or text in those files?.

    Reply

Leave a Reply

You may also like-

Google: Find Free MP3s, WMAs, OGGs, and Other Music FilesGoogle: Find Free MP3s, WMAs, OGGs, and Other Music FilesPeople leave music files in unprotected directories all of the time. Here's how to get to them. Come get your free mp3s. We all ... Download Free Cell Phone Videos (3gp) with GoogleDownload Free Cell Phone Videos (3gp) with GoogleDo you want to download a bunch of free videos for your cellular phone? This technique will show you how to search google to ...