linux

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


                           send to a friend                                            moby@mylinuxplanet.com      

Please free to mail your queries and feed back at moby@mylinuxplanet.com a free linux tutorial website


Linux Tutorials

About This Site

History of Linux

Open Source

File system terms

Linux File System

History of Shell

Opening a Shell Prompt

Shell Prompt Basics

Linux Shell Prompt

Linux Commands

Viewing Text Files From The Shell

Manipulating Information from Shell

Linux Help

Managing Linux Files

Multiple Commands Usage

Managing Linux Directories

Linux Directory Commands

Locating And Search Commands

Command History

Wildcard Characters

Creating a Linux User

Ownership And Permissions

File Compression

Virtual Console Logout & Shutdown

Running Background Process

Shell Prompt Keyshortcuts

Clearing And Resseting Terminal

Vi Editor

Shell Scripting

Installing and Removing Applications

Servers in Linux

Our Link Partners