Home > Operation and Maintenance > Linux Operation and Maintenance > How to delete files with garbled file names in Linux

How to delete files with garbled file names in Linux

WBOY
Release: 2022-06-22 16:55:28
Original
9179 people have browsed it

删除方法:1、利用“ls -i”命令获取文件的节点号,ls命令用于显示指定工作目录下之内容;2、通过获取到的文件节点号利用find命令即可删除指定的文件,语法为“find -inum 节点号 -delete”。

How to delete files with garbled file names in Linux

本教程操作环境:linux7.3系统、Dell G3电脑。

linux怎么删除乱码文件名的文件

往服务器上传了一个中文名称的文件,到了服务器上之后文件名变成了乱码:

''$'\241\266\307\340\314''O'$'\241\267\300\353\261\360\270\320\321\324''.txt'

通过rm命令无法删掉它。

解决方法:

1、使用ls -i命令获取文件的节点号:

917969 ''$'\241\266\307\340\314''O'$'\241\267\300\353\261\360\270\320\321\324''.txt'
Copy after login

得到了文件的节点号917969

2、使用find -inum 节点号 -delete,即可删除此文件。

find -inum 917969 -delete
Copy after login

How to delete files with garbled file names in Linux

推荐学习:Linux视频教程

The above is the detailed content of How to delete files with garbled file names in Linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template