Pick: a Linux Command Line fuzzy search tool | Linux China, pick fuzzy search

Source: Internet
Author: User
Tags composer install arch linux linux mint

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.

  
 
  1. pacaur -S pick

Or,

  
 
  1. packer -S pick

Or,

  
 
  1. yaourt -S pick

Debian, Ubuntu, and Linux Mint users can install Pick by running the following command.

  
 
  1. 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.

  
 
  1. wget https://github.com/calleerlandsson/pick/releases/download/v1.9.0/pick-1.9.0.tar.gz

  2. tar -zxvf pick-1.9.0.tar.gz

  3. cd pick-1.9.0/

Use the following command for Configuration:

  
 
  1. ./configure

Finally, build and install Pick:

  
 
  1. make

  2. 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.

  
 
  1. mkdir -p abcd/efgh/ijkl/mnop/qrst/uvwx/yz/

Now, you want to enter the Directory/ijkl/. You have two options. AvailablecdCommand:

  
 
  1. cd abcd/efgh/ijkl/

Alternatively, create a shortcut [6] or point the alias to this directory, so that you can quickly enter this directory.

HoweverpickCommands are much simpler. Let's look at the example below.

  
 
  1. 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 alsopickThe command is mixed with other commands.

This is another example.

  
 
  1. find -type f | pick | xargs less

This command allows you to use a file in the current directorylessTo 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.

  
 
  1. 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 resultsabcdDirectoryostechnixDirectory.

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.

  
 
  1. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.