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:
- Easy to use syntax – fd *pattern* instead of find -iname *pattern*.
- Colorful output similar to the one of ls command.
- Fast performance. Developer’s benchmarks are available here.
- Smart search with case-insensitive by default and switches to case sensitive if patter containers an uppercase symbol.
- Does not look in hidden files and directories by default.
- Does not look into .gitignore by default.
- 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.
Leave A Comment?