Linux delete garbled file operation skills

  
                

In the Linux system, some Chinese files become garbled files. For users with obsessive-compulsive disorder, if you see garbled files like delete, how do you delete Linux garbled files? This can be done by deleting the inode node.

[root @ localhost tmp] # ls -l

total 1024

-r - r - r-- 1 root root 624541 May 3 09 :33 mkisofs-2.01-10.7.el5.x86_64.rpm

srwxrwxrwx 1 mysql mysql 0 Jul 2 12:26 mysql.sock

--rw-r--r-- 1 root Root 0 Jul 27 08:27 garbled file

-rw-r--r-- 1 root root 0 Jul 27 08:26 嘎儿

There are 2 Chinese names in my system. File, find the inode of 2 files

[root@localhost tmp]# ls -il

total 1024

917852 -r--r--r-- 1 root root 624541 May 3 09:33 mkisofs-2.01-10.7.el5.x86_64.rpm

919797 srwxrwxrwx 1 mysql mysql 0 Jul 2 12:26 mysql.sock

920533 -rw- R--r-- 1 root root 0 Jul 27 08:27 garbled file

918587 -rw-r--r-- 1 root root 0 Jul 27 08:26 嘎儿

The inode of the garbled file is 920533. Let's delete it first, use the find command to find the inode and then delete

[root@localhost tmp]# find . -inum 920533

. /garbled file

[root@localhost tmp]# find . -inum 920533 -exec rm -f {} \\;

[root@localhost tmp]# ls -l

total 1024

-r--r--r -- 1 root root 624541 May 3 09:33 mkisofs-2.01-10.7.el5.x86_64.rpm

srwxrwxrwx 1 mysql mysql 0 Jul 2 12:26 mysql.sock

-rw- R--r-- 1 root root 0 Jul 27 08:26 嘎儿

The file named garbled file has been deleted

The above is the introduction of Linux to remove garbled files, you There should also be some garbled files in the system, you can use the method of this article to delete these files.

Copyright © Windows knowledge All Rights Reserved