Home >Common Problem >How to solve the problem that there is a file in Linux but cannot be found?
Solutions to the problem that there is a file but cannot be found in Linux: 1. Open a terminal command line window; 2. Use the "find" command to find the file; 3. Use the wildcard "*" to search for the file; 4. , press Enter to execute the command to complete the file search. Opening the terminal command line window refers to opening the command line window in the Linux system.
The operating environment of this article: Linux 5.18.14 system, DELL G3 computer.
1. Solution to the problem that Linux obviously has files but cannot find them
1. Open the terminal command line window
Open the command in the Linux system Run the window and prepare for subsequent operations.
2. Use the "find" command to find the file
First, you can use the "find" command to find the file. Note that you must use the "name" parameter first, and then Add the file name. For example, enter the "find -name 'filename.c'" command, where "filename.c" is the name of the file to be found. The specific code is as follows:
find -name "filename.c"
3. Use the wildcard character "*" to search for files
If you still cannot find the target file using the method in the previous step, then You can use the wildcard "*" to search. For example, enter the "find -name 'file*.c'" command to view all files whose file names begin with "file". The specific code is as follows:
find -name "file*.c"
4. Press Enter to execute the command to complete the file search
After the command input is completed, press Enter to execute the command to find the target file.
2. Reasons why Linux cannot find the file
1. Inconsistent encoding format
The encoding format when the program is running and the parameters transferred to the program Whether the encoding format is consistent, you can print the log in the program to verify.
2. Escape character problem
There are escape characters in the file path.
3. User identity of running the program
Different users running the program may also cause inconsistent encoding formats.
4. Problems with the parent directory
Are there any problems with the user, user group, and permissions of the parent directory of the file (generally referring to the upper directory of the file), such as (and the running user of the program) belong to the same user and the same user group.
5. Information synchronization problem
The program has modified the file (file name, user group where the file is located, file permissions, etc.), but the operating system has not completed processing. When I operate the file through the operating system, I find that the file cannot be found.
6. Number of file handles
In extreme cases, the number of file handles opened by the operating system reaches the upper limit, and there are no available file handles to open the file.
Extended reading
Introduction to Linux
Linux, the full name is GNU/Linux, is a UNIX-like operating system that is free to use and freely disseminated. Its kernel is written by Linus· First released by Linus Benedict Torvalds on October 5, 1991, it is mainly inspired by the ideas of Minix and Unix. It is a POSIX-based multi-user, multi-tasking, multi-threading and multi-threading software. CPU operating system. It supports 32-bit and 64-bit hardware and can run major Unix software tools, applications and network protocols.
Linux inherits the network-centric design philosophy of Unix and is a multi-user network operating system with stable performance. There are hundreds of different Linux distributions, such as Debian and Archlinux based on community development, and Red Hat Enterprise Linux, SUSE, Oracle Linux, etc. based on commercial development.
Comprehensive list of developer productivity tools
From manual to automated, from repetition to innovation, the process of technological evolution is accompanied by the development of developer tool products, so here is a summary of recent years 22 programmer productivity tools with good reputation and widely used.
1. R&D project management and collaboration: PingCode
Advantages: Makes work advancement, progress/issue tracking, and team collaboration easier, TOP1 in the 2021 R&D project management list (36Kr) .
Introduction: Covers the entire R&D life cycle, and is widely used for management and collaboration of requirements, versions, projects (agile/kanban/waterfall), testing, defects, documents, performance, etc. It also integrates mainstream tools such as github, gitlab, and jinkens, and supports multiple deployment methods such as private deployment and online.
[Tutorial/Official Website]
2. Task management/Gantt chart creation tool: Worktile
Advantages: Mature functions, high cost performance, and the team with the highest domestic market share Task Tool;
Introduction: Functionally, Worktile is a collection of tools, which has OKR goal management, project management, program management, project planning, project risk, project cost management, enterprise network disk, approval, and briefing and other abilities. It also has strong customization capabilities, can configure processes, forms, fields, data reports that suit various project teams, and has a rich template market.
[Official website/tutorial]
3. Distributed version control system: Git
Advantages: distributed development, fast speed, flexibility
Introduction: Git is an open source distributed version control system that can handle version management of projects from very small to very large efficiently and at high speed. It is also an open source version control software developed by Linus Torvalds to help manage Linux kernel development.
[Tutorial/Official Website]
4. Database management tool: Navicat
Advantages: efficient, safe, and the best database management tool.
Introduction: "Navicat" is a set of database management tools that can create multiple connections to facilitate the management of different types of databases such as MySQL, Oracle, PostgreSQL, SQLite, SQL Server, MariaDB and MongoDB. It is compatible with Compatible with cloud databases such as Alibaba Cloud, Tencent Cloud, Huawei Cloud, Amazon RDS, Amazon Aurora, Amazon Redshift, Microsoft Azure, Oracle Cloud and MongoDB Atlas.
The above is the detailed content of How to solve the problem that there is a file in Linux but cannot be found?. For more information, please follow other related articles on the PHP Chinese website!