Linux file search technology Daquan

  

Each operating system is composed of thousands of different kinds of files. Among them are the files that come with the system itself, the user's own files, and shared files. Sometimes we often forget where a file is placed on the hard drive. Finding a file in Microsoft's WINDOWS operating system is quite simple. Just click "Start" - "Search" on the desktop to find it on the local hard disk, LAN, or even INTERNET in various ways. Various documents, documents.

But users who use Linux are not so lucky. Finding a file on Linux is really a cumbersome thing. After all, in Linux we need to use a dedicated "find" command to find files on the hard disk. The file expression format under Linux is very complicated. Unlike WINDOWS, DOS is a unified AAAAAAA.BBB format, so it is convenient to find. In WINDOWS, as long as you know the file name or suffix of the file to be found, it is very easy to find. The command to find files in Linux is usually the "find" command. The "find" command can help us find the files we need in the daily affairs of using and managing Linux.

For Linux novices, the "find" command is also a way to understand and learn the characteristics of Linux files. Because Linux has a large number of distributions, the version is upgraded very quickly. In Linux books, the location of a configuration file is often written. Often Linux novices can't find it according to the figure. For example, the hard disk location and file directory of some important configuration files in REDHAT Linux7.O and REDHATLinux7.1 have changed a lot. If you don't learn to use the "find" command, then in thousands of Linux files. It's quite difficult to find one of these profiles, and I've had this kind of pain before I'm proficient in the "find" command. Ok, here's a detailed introduction to the full use and use of the powerful "find" command.


I. By file name lookup method:

This method is as easy to understand as looking up files under WINDOWS. If you put this file in a single folder, you can easily find it by using the common "ls" command, then you can't impress you with the "find" command. After all, "find" "The power of the command is more than this. If you know the file name of a file, you don't know which folder the file is placed in, or even a layered folder. For example, suppose you forgot httpd.conf. This file is in which directory of the system, even somewhere in the system, you can use the following command:

find /-name httpd.conf

This command syntax It seems easy to understand, just write the -name directly after the find, indicating that the system is required to find the file name, and finally write the target file name httpd.conf. Wait a moment, the system will display on the computer screen. Find the list of results:

etc/httpd/conf/httpd.conf

This is the full path of the httpd.conf file in the Linux system. The search is successful.

If the system does not display the result after entering the above search command, then do not think that the system does not execute the find/-name httpd.conf command, but the Apache server may not be installed on your system. In this case, if you install the Apache web server, then Then use find /-name httpd.conf to find this configuration file.


Linux file search technology Daquan 2
Linux file search technology Daquan three


Responsible Editor: In order to make the column better for you, I hope you give us more comments.
My MSN is [email protected], thank you for your support.

Copyright © Windows knowledge All Rights Reserved