In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
How to delete garbled or special character files in Linux? I believe that many inexperienced people are at a loss about this, so this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
In the linux file system, each file has an I-node number, which can be managed by the I-node number. First go to the directory where the garbled file or directory is located
Use the ls-I command to find the inode of a file or directory
The numeric string in front of the file or directory is inode, and then use the find command to query and delete the file or directory.
Note: this method applies only to deleting files or empty folders.
How to delete a non-empty folder?
First of all, check inode, and then use the following command:
Find-inum 2236429-exec rm-rf {}\
You will be prompted that the file or folder cannot be found, but it has actually been deleted.
How to delete files with garbled or special characters under Linux.
There is a problem today. A file name is "- MXV9.log". When you delete it directly with rm, you will report an error.
[localhost] rm-MXV9.log
Rm: illegal option-- M
Rm: illegal option-- X
Rm: illegal option-- V
Rm: illegal option-- 9
Rm: illegal option.
Rm: illegal option-- l
Rm: illegal option-- o
Rm: illegal option-- g
Usage: rm [- Rfir] file...
I began to think about deleting with quotation marks, and found that deleting with quotation marks also reported illegal option's mistake.
I found some information and found that this kind of file can be deleted in this way.
Ls-I first finds the inode of the file, and then deletes it with the find command
[localhost] ls-ilrt100985-rw-r--r-- 1 tbcs users 0 Apr 18 11:32-MXV9.log
The 100985 in the first column is the inode of the file. You can delete the file by executing the following command on the host
[localhost] find. /-inum 100985-exec rm {}\
This method is suitable for deleting files with garbled file names or special characters.
For example, if the file name is "* .txt", if you execute rm * .txt directly, all files ending in .txt in the folder will be deleted.
What is Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.
After reading the above, do you know how to delete garbled or special character files in Linux? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.