linux

User Login

User Name
Password
   
Forgot Password                  Sign Up

What's up ?

We value your feedbacks,ideas and your articles.Please navigate to the following links.

  • Feedback
  • I have an Idea
  • Advertise
  • The Article

    Would you like to post an article on this web site, then please navigaet here to do that.

    Submit an article

    Newletter SignUp

    Please register to receive a Newsletter.

    Register Here

    Linux Locating Commands

    Locating Files and Directories

    There may be times when you know a file or directory exists but you do not know where to find it.

    There are several commands you can use to search for it.Such as "find", "locate", and "which".

    Find

    The format of the find command is:

    eg:find path pattern

    If you do not specify a path, find starts in the current working directory and looks through all subdirectories for the specified pattern.

    The find command has many options that you can review by entering man find at a shell prompt.

    Locate

    The format of the locate command is: eg:locate pattern

    With locate, you can see every file or directory whose name contains the search criterion.

    The locate command works very quickly, as long as the database is up to date. That database is automatically updated on a nightly basis through a cron job. cron is a small program that runs in the background, performing various tasks (such as updating the locate database) at regularly scheduled intervals. Refer to the RedHat Enterprise Linux System Administration Guide for more information on cron.

    To update the database manually, log in as root (type su - at a shell prompt and then your root password) and type the command updated.

    After a few minutes, the slocate database that is used by the locate command is updated.

    Which

    The format of the which command is:

    eg: which command

    which returns the location of binary, or executable, shell commands. The information provided by whichis useful for creating application launchers.

    whereis

    The format of the whereis command is: eg: whereis command

    whatis

    The format of the whatis is: eg: whatis command