In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
The fd command provides a simple and straightforward way to search the Linux file system.
Fd is an ultra-fast, Rust-based replacement for the Unix/Linux find command. It does not provide all the powerful features of find. However, it does provide enough functionality to cover 80% of the situations you may encounter. Features such as good planning and convenient syntax, color output, smart case, regular expressions, and parallel command execution make fd a very capable successor.
Installation
Go to the fd GitHub page and view the installation section. It covers how to install programs on macOS, Debian/Ubuntu Red Hat, and Arch Linux. After the installation is complete, you can get a complete overview of all available command line options by running help, concise help through fd-h, or more detailed help through fd-help.
Simple search
Fd is designed to help you easily find files and folders in your file system. You can use fd to perform the simplest search with a parameter that is anything you want to search for. For example, suppose you are looking for an Markdown document that contains the word services as part of the file name:
$fd servicesdownloads/services.md
If called with only one parameter, fd recursively searches the current directory to find any files and / or directories that match Mo's parameters. The equivalent search using the built-in find command is as follows:
$find. -name 'services'downloads/services.md
As you can see, fd is much simpler and requires less input. In my mind, it is always right to do more with less input.
Files and folders
You can use the-t parameter to limit the search to a file or directory, followed by a letter that represents what you want to search. For example, to find all files in the current directory that contain services in their filenames, you can use:
$fd-tf servicesdownloads/services.md
And, find all directories that contain services in the filename of the current directory:
$fd-td servicesapplications/serviceslibrary/services
How do I list all documents with the .md extension in the current folder?
$fd .mdadministration / administration.mddevelopment/elixir/elixir_install.mdreadme.mdsidebar.mdlinux.md
As you can see from the output, fd can not only find and list files in the current folder, but also find files in subfolders. It's simple.
You can even use the-H parameter to search for hidden files:
Fd-H sessions.. bash_sessions
Specify directory
If you want to search for a specific directory, the name of that directory can be passed to fd as the second parameter:
$fd passwd/etc/ etc/default/passwd/etc/pam.d/passwd/etc/passwd
In this example, we tell fd that we want to search the etc directory for all instances of the word passwd.
Global search
What if you know part of the file name, but don't know the folder? Suppose you download a book about Linux network management, but you don't know where it is saved. No problem:
Fd Administration / / Users/pmullins/Documents/Books/Linux/Mastering Linux Network Administration.epub
Summary
Fd is an excellent alternative to the find command, and I'm sure you'll find it as useful as I do. To learn more about this command, just browse the man page.
The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.