Due to encoding reasons, garbled characters will be generated when uploading or creating Chinese files or directories on a Linux server. If you want to delete it, you cannot delete it with the rm command. In this case, you can use the find command to delete the garbled files or directories. In the Linux file system, each file has an i-node number, and the files can be managed by the i-node number. First enter 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 the inode. Next, use the find command to query and delete this file or directory. Note: This method only works for deleting files or empty folders. How to delete a non-empty folder? First, check the inode, and then use the following command: find -inum 2236429 -exec rm -rf {} \; It will prompt that the file or folder cannot be found, but it has actually been deleted. How to delete files with garbled or special characters in the file name under Linux. I encountered a problem today. A file name is
I started thinking about deleting with quotes, but found that deleting with quotes also reported an I found some information and found that this kind of file can be deleted like this First ls -i to find the file's inode, then delete it with the find command [localhost]ls -ilrt 100985 -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. Execute the following command on the host to delete the file [localhost]find ./ -inum 100985 -exec rm {} \; This method is suitable for deleting files with garbled or special characters. For example, if the file name is "*.txt" and you directly execute rm *.txt, all files ending with .txt in the folder will be deleted. Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links You may also be interested in:
|
<<: Navicat for MySQL scheduled database backup and data recovery details
>>: Videojs+swiper realizes Taobao product details carousel
This article shares the specific code of the vue-...
As a basic element of a web page, images are one ...
This article summarizes the knowledge points of M...
[Who is nslookup?] 】 The nslookup command is a ve...
Using Nginx's proxy_cache to build a cache se...
Test: Chrome v80.0.3987.122 is normal There are t...
Single page application characteristics "Ass...
Why do we achieve this effect? In fact, this ef...
Google China has released a translation tool that ...
Formation of the grid system In 1692, the newly c...
This article records the installation and configu...
Two cases: 1. With index 2. Without index Prerequ...
Easy installation of opencv2: conda install --cha...
Table of contents vue custom directive Global Dir...
Table of contents 1. Download 2. Installation and...