0

Concept of a Linux terminal full of text on a laptop

Linux offers six different ways to search, and each has its merits. We’ll demonstrate how to use find, locate, which, whereis, whatis, and apropos. Each excels at different tasks; here’s how to choose the right tool for the job.

You’re spoiled for choice when it comes to commands for searching and finding in Linux. Why so many? Well, they each have their specialties and perform better than the others in certain circumstances. You could think of them as a sort of Swiss-Army knife for searching. We’re going to look at each blade in turn and find out its particular strengths.

The find Command

The behavior of the find command is difficult to determine by trial and error. Once you understand the syntax, you start to appreciate its flexibility and power.

The simplest way to use find is to just type find and hit enter.

find

find command in a terminal window

Used in this way find behaves like ls, but it lists all of the files in the current directory and those in subdirectories.

output from find command in a terminal window

Some implementations of find require you to put the . for the current directory. If this is the case with your version of Linux,  use the following command:

find .

Read the remaining 177 paragraphs


Post a Comment Blogger

We welcome comments that add value to the discussion. We attempt to block comments that use offensive language or appear to be spam, and our editors frequently review the comments to ensure they are appropriate. As the comments are written and submitted by visitors of The Sheen Blog, they in no way represent the opinion of The Sheen Blog. Let's work together to keep the conversation civil.

 
Top