I have a directory named - AB02530618-20191217-163059.bin_decomprypted (1) created using window. How can I delete this in Linux using command?
Asked
Active
Viewed 92 times
0
-
5Does this answer your question? [How to remove a file with two words separated by a space in the shell?](https://unix.stackexchange.com/questions/226860/how-to-remove-a-file-with-two-words-separated-by-a-space-in-the-shell) The general approach is to use quotes around the name, so `rm 'AB02530618-20191217-163059.bin_decomprypted (1)'` – Andy Dalton Feb 03 '20 at 01:03
-
how can I delete using inode number? – kurramkurram D Feb 03 '20 at 03:22
-
Did you try using quotes like I suggested above? If so, please edit your question and include the command you issued and the response that you received. – Andy Dalton Feb 03 '20 at 03:29
-
You can't delete by inode number. In most file systems, that would leave a dangling directory entry. Also, hard links can mean an inode is referenced from more than one directory entry. The file system detects when the last reference for an inode goes away (including being open in any process) before cleaning up the inode and data blocks. – Paul_Pedant Feb 03 '20 at 11:28
1 Answers
0
I assume the directory is empty -- if not, you can't delete it anyway.
For file deletions, one trick is to wildcard as much of the name as you can, and use the -i (interactive) option to decide what subset of the matches to delete, one by one.
The rmdir command does not have that, but the recursive file removal will deal with directories. E.g.
rm -r -i AB*20191217-163059*
And examine everything it offers before you type y or n.
Paul_Pedant
- 8,228
- 2
- 18
- 26