Pick: a Linux Command Line fuzzy search tool | Linux China, pick fuzzy search
It allows you to select from a series of options through the ncurses (3X) interface, and also supports fuzzy search. This tool is useful when you want to select a directory or file whose name contains non-English characters. -- Sk
Navigation Composer install Pick11 % Usage 37% Compiled from | https://www.ostechnix.com/pick-commandline-fuzzy-search-tool-linux/
Author | Sk
Translator | lujun9972
Today, we are going to talk about an interesting command line tool called Pick. It allows you to select from a series of options through the ncurses (3X) interface, and also supports fuzzy search. This tool is useful when you want to select a directory or file whose name contains non-English characters. You do not have to learn how to enter non-English characters. With Pick, you can easily search, select, and browse the file or enter the directory. You don't even need to enter any characters to filter files/directories. This is suitable for those who have a large number of directories and files.
Install Pick
For Arch Linux and its derivatives, Pick is placed in AUR [1. Therefore, Arch users can install it using auxiliary tools such as Pacaur [2], Packer [3], and Yaourt [4.
pacaur -S pick
Or,
packer -S pick
Or,
yaourt -S pick
Debian, Ubuntu, and Linux Mint users can install Pick by running the following command.
sudo apt-get install pick
For other releases, You Can [5] download the latest installation package and install it as follows. When writing this Guide, the latest version is 1.9.0.
wget https://github.com/calleerlandsson/pick/releases/download/v1.9.0/pick-1.9.0.tar.gz
tar -zxvf pick-1.9.0.tar.gz
cd pick-1.9.0/
Use the following command for Configuration:
./configure
Finally, build and install Pick:
make
sudo make install
Usage
By integrating it with other commands, You can greatly simplify your work. I will give some examples here to help you understand how it works.
Let's create a bunch of directories first.
mkdir -p abcd/efgh/ijkl/mnop/qrst/uvwx/yz/
Now, you want to enter the Directory/ijkl/
. You have two options. Availablecd
Command:
cd abcd/efgh/ijkl/
Alternatively, create a shortcut [6] or point the alias to this directory, so that you can quickly enter this directory.
Howeverpick
Commands are much simpler. Let's look at the example below.
cd $(find . -type d | pick)
This command will list all the directories and Their subdirectories in the current working directory. You can use the up and down arrows to select the directory you want to enter and press Enter.
Like this:
In addition, it filters directories and files based on the content you enter. For example, the following result is displayed when I enter "or.
This is just an example. You can alsopick
The command is mixed with other commands.
This is another example.
find -type f | pick | xargs less
This command allows you to use a file in the current directoryless
To view it.
Want to see other examples? What else. The following command allows you to select a file or directory under the current directory and migrate it to another place. For example, here we migrate/home/sk/ostechnix
.
mv "$(find . -maxdepth 1 |pick)" /home/sk/ostechnix/
Select the file to be migrated through the up and down buttons, and press enter to migrate it/home/sk/ostechnix/
Directory.
As shown in the preceding resultsabcd
Directoryostechnix
Directory.
The usage is unlimited. Even the Vim editor has a plug-in called pick. vim [7], which makes it easier to select in Vim.
For more information, see its man page.
man pick
This is the end of our explanation. I hope this tool can help you. If you think our guide is useful, share it with your social network and recommend it to you.
Via: https://www.ostechnix.com/pick-commandline-fuzzy-search-tool-linux/
Author: SK [9] Translator: lujun9972 Proofreader: wxy
This article was originally compiled by LCTT and launched with the honor of Linux in China
LCTT Translator Lujun9972? ? ? ? Total translations: 69 Contribution time: 46 days
Recommended articles
<Slide left and right to view related articles>
Click an image, enter the Document ID, or identify the QR code.
Original article link Visit the original article link to obtain the link that can be clicked, the full-size source image, and related articles.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger. Http://blog.csdn.net/F8qG7f9YD02Pe/article/details/79056189