fd – A Simple and Fast Alternative to Find Command

Configurare noua (How To)

Situatie

Most of the Linux users are well familiar with the find command and the many cases it can be used. Today we are going to review an alternative to find command, called fd.

fd, is a simple, fast and user-friendly tool meant to simply perform faster compared to find. It is not meant to completely replace find, but rather give you an easy to use alternative that performs slightly faster.

Some of the notable features of fd:

  1. Easy to use syntax – fd *pattern* instead of find -iname *pattern*.
  2. Colorful output similar to the one of ls command.
  3. Fast performance. Developer’s benchmarks are available here.
  4. Smart search with case-insensitive by default and switches to case sensitive if patter containers an uppercase symbol.
  5. Does not look in hidden files and directories by default.
  6. Does not look into .gitignore by default.
  7. Unicode awareness.

Solutie

How to Install fd in Linux

We are going to look at how to install fd in different Linux distributios.

For Ubuntu and Debian based distros, you will need to download the latest fd version from the release page and install it using following commands.

On Other Linux distributions, you can install fd from the default repository using package manager as shown

How to Use fd in Linux

Similar to find command, fd has many uses cases, but let’s start at checking the available options:

Let’s have a look at few examples. You can run fd without any arguments, the output is very similar to ls -R command.

In the example below, I have taken only the first 10 results for shorter output of the command.

Let’s say we want to find all jpg files. We can use the “-e” flag to filter by file extension:

If you want to specify a search directory, you simply need to give it as argument:

Just as find, you can use -x or --exec arguments to perform parallel command execution with the search results.

Here is an example where we will use chmod to change permissions of the image files

This was a brief review of the fd command, that some users may find easier to use and faster. As mentioned earlier in this article fd is not meant to completely replace find, but rather provide a simple usage, easier search and better performance. Fd does not take much space and is a nice tool to have in your arsenal.

 

 

Tip solutie

Permanent

Voteaza

(1 din 6 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?