


What is the linux file query command?
The Linux file query command is the "find" command. This command is used to find files in the specified directory. Any string before the parameter will be regarded as the directory name to be found; if you use this command , without setting any parameters, the find command will search for subdirectories and files in the current directory, and display all found subdirectories and files.
#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.
What is the Linux file query command?
find.
The Linux find command is used to find files in the specified directory. Any string preceding the parameter will be treated as the name of the directory to be searched. If you use this command without setting any parameters, the find command will search for subdirectories and files in the current directory. And all found subdirectories and files will be displayed.
Syntax
find path -option [ -print ] [ -exec -ok command ] {} \;
Parameter description:
find determines path and expression according to the following rules. The first one on the command line - (), the part before ! is path. , followed by expression. If path is an empty string, the current path is used. If expression is an empty string, -print is used as the default expression. There are as many as twenty or thirty options that can be used in
expression. Only the most commonly used ones are introduced here.
-mount, -xdev : 只检查和指定目录在同一个文件系统下的文件,避免列出其它文件系统中的文件 -amin n : 在过去 n 分钟内被读取过 -anewer file : 比文件 file 更晚被读取过的文件 -atime n : 在过去 n 天内被读取过的文件 -cmin n : 在过去 n 分钟内被修改过 -cnewer file :比文件 file 更新的文件 -ctime n : 在过去 n 天内创建的文件 -mtime n : 在过去 n 天内修改过的文件 -empty : 空的文件-gid n or -group name : gid 是 n 或是 group 名称是 name -ipath p, -path p : 路径名称符合 p 的文件,ipath 会忽略大小写 -name name, -iname name : 文件名称符合 name 的文件。iname 会忽略大小写 -size n : 文件大小 是 n 单位,b 代表 512 位元组的区块,c 表示字元数,k 表示 kilo bytes,w 是二个位元组。 -type c : 文件类型是 c 的文件。 d: 目录 c: 字型装置文件 b: 区块装置文件 p: 具名贮列 f: 一般文件 l: 符号连结 s: socket -pid n : process id 是 n 的文件
You can use ( ) to separate expressions and use the following operations.
exp1 -and exp2 ! expr -not expr exp1 -or exp2 exp1, exp2
Example
List all files with .c suffix in the current directory and its subdirectories:
# find . -name "*.c"
List all files in the current directory and its subdirectories File list:
# find . -type f
List all files in the current directory and its subdirectories that have been updated in the last 20 days:
# find . -ctime 20
Find the change time in the /var/log directory 7 days ago Ordinary files and ask them before deleting:
# find /var/log -type f -mtime +7 -ok rm {} \;
Find files in the current directory for which the owner of the file has read and write permissions, and the user in the group to which the file belongs and other users have read permissions:
# find . -type f -perm 644 -exec ls -l {} \;
Find all ordinary files with a file length of 0 in the system and list their full paths:
# find / -type f -size 0 -exec ls -l {} \;
Recommended learning: "Linux Video Tutorial"
The above is the detailed content of What is the linux file query command?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The main reasons why you cannot log in to MySQL as root are permission problems, configuration file errors, password inconsistent, socket file problems, or firewall interception. The solution includes: check whether the bind-address parameter in the configuration file is configured correctly. Check whether the root user permissions have been modified or deleted and reset. Verify that the password is accurate, including case and special characters. Check socket file permission settings and paths. Check that the firewall blocks connections to the MySQL server.

C language conditional compilation is a mechanism for selectively compiling code blocks based on compile-time conditions. The introductory methods include: using #if and #else directives to select code blocks based on conditions. Commonly used conditional expressions include STDC, _WIN32 and linux. Practical case: Print different messages according to the operating system. Use different data types according to the number of digits of the system. Different header files are supported according to the compiler. Conditional compilation enhances the portability and flexibility of the code, making it adaptable to compiler, operating system, and CPU architecture changes.

The five basic components of Linux are: 1. The kernel, managing hardware resources; 2. The system library, providing functions and services; 3. Shell, the interface for users to interact with the system; 4. The file system, storing and organizing data; 5. Applications, using system resources to implement functions.

There are many reasons why MySQL startup fails, and it can be diagnosed by checking the error log. Common causes include port conflicts (check port occupancy and modify configuration), permission issues (check service running user permissions), configuration file errors (check parameter settings), data directory corruption (restore data or rebuild table space), InnoDB table space issues (check ibdata1 files), plug-in loading failure (check error log). When solving problems, you should analyze them based on the error log, find the root cause of the problem, and develop the habit of backing up data regularly to prevent and solve problems.

MySQL cannot run directly on Android, but it can be implemented indirectly by using the following methods: using the lightweight database SQLite, which is built on the Android system, does not require a separate server, and has a small resource usage, which is very suitable for mobile device applications. Remotely connect to the MySQL server and connect to the MySQL database on the remote server through the network for data reading and writing, but there are disadvantages such as strong network dependencies, security issues and server costs.

The solution to MySQL installation error is: 1. Carefully check the system environment to ensure that the MySQL dependency library requirements are met. Different operating systems and version requirements are different; 2. Carefully read the error message and take corresponding measures according to prompts (such as missing library files or insufficient permissions), such as installing dependencies or using sudo commands; 3. If necessary, try to install the source code and carefully check the compilation log, but this requires a certain amount of Linux knowledge and experience. The key to ultimately solving the problem is to carefully check the system environment and error information, and refer to the official documents.

The main reasons for MySQL installation failure are: 1. Permission issues, you need to run as an administrator or use the sudo command; 2. Dependencies are missing, and you need to install relevant development packages; 3. Port conflicts, you need to close the program that occupies port 3306 or modify the configuration file; 4. The installation package is corrupt, you need to download and verify the integrity; 5. The environment variable is incorrectly configured, and the environment variables must be correctly configured according to the operating system. Solve these problems and carefully check each step to successfully install MySQL.

Unable to access MySQL from the terminal may be due to: MySQL service not running; connection command error; insufficient permissions; firewall blocks connection; MySQL configuration file error.
