Mac Find command

Source: Internet
Author: User

Searching for files with the Find command

The find command is very efficient and simple to use. The find command from Unix,os X and Linux systems also supports this command. The most basic operation of find is:
Find File Path parameter

Copy Code

For example, you can use the following command to search the user folder for the file containing screen in the name
Find ~-iname "screen*"
Copy Code
You can also find specific files in a specific folder, such as
Find ~/library/-iname "Com.apple.syncedpreferences.plist"
Copy Code
This command can find the Com.apple.syncedpreferences.plist file in the Library folder.

Searching for files with the Mdfind command

The Mdfind command is the terminal interface of the spotlight feature, which means that Mdfind commands will not work if spotlight is disabled. The Mdfind command is fast and efficient. The most basic ways to use this are:
Mdfind-name file name
Copy Code
For example, you can search for a photo 1.PNG file using the following command
Mdfind-name "Photo 1.PNG"
Copy Code
Because Mdfind is the terminal interface for Spotlight functionality, you can also use Mdfind to find the contents of files and folders, such as searching for all files containing will Pearson text with the following command:
Mdfind "would Pearson"
Copy Code
The Mdfind command also allows you to search the contents of a specific folder through the-onlyin parameter, such as
Mdfind-onlyin ~/library plist
Copy Code
This command can search all the plist files in the Library folder.

Mac Find command

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.