Linux Delete garbled files

Source: Internet
Author: User

Do not know if you have encountered this kind of file, because it is garbled, the file cannot be deleted, then we can consider using the following command to delete files or directories

Ls-i//List file nodes

Find./-inum XXX (node number)-print-exec Rm-rf {} \; Delete a node number file

Find. -inum XXXX (node number)-exec mv {} file.txt \; Actually we can also execute this command, modify the garbled file name as normal file name

[Email protected] installation]# Ls-li
Total 1307844
1343491-rw-r--r--1 root root 423559952 Sep amd64_db_9204_Disk1.cpio.gz
1343492-rw-r--r--1 root root 578948873 Sep amd64_db_9204_Disk2.cpio.gz
1392641-rw-r--r--1 root root 334834987 Sep amd64_db_9204_Disk3.cpio.gz
1490946-rw-r--r--1 root root 225374 June 2 02:55 P2617419_220_generic.zip
1622017-rw-r--r--1 root root 286639 June 2 02:55 P3238244_9204_linux.zip
1622018-rw-r--r--1 root root 5814 June 2 02:55 P4198954_40_linux.zip
1490945-RWXRWXRWT 1 root root 0 Jan 1 1970 RBh????? ^?? ^??? PB??!? L??? 9?????? s?????? Y??? 9 '?? K? E?? ~? V6?? #Xh??? ({??????? Q?????? >??? WJ?} A? A)?? _ys
[[email protected] installation]# find. -inum 1490945-exec rm {}-RF \;
[email protected] installation]# LL
Total 1307840
-rw-r--r--1 root root 423559952 Sep amd64_db_9204_Disk1.cpio.gz
-rw-r--r--1 root root 578948873 Sep amd64_db_9204_Disk2.cpio.gz
-rw-r--r--1 root root 334834987 Sep amd64_db_9204_Disk3.cpio.gz
-rw-r--r--1 root root 225374 June 2 02:55 P2617419_220_generic.zip
-rw-r--r--1 root root 286639 June 2 02:55 P3238244_9204_linux.zip
-rw-r--r--1 root root 5814 June 2 02:55 P4198954_40_linux.zip

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.