0

I tried to compress a backup file via tar command on Linux (Oracle Enterprise Linux 8) but after the execution, i created a file named '--use-compress-program=pigz' by mistake.

The problem is, i can't delete this file with any of the commands. Tried commands below:

rm -rf '--use-compress-program=pigz'
rm -rf \'--use-compress-program=pigz\'
rm -rf *compress*

Any of these doesn't work. They all give errors below:

rm: unrecognized option ....
rm: cannot remove ... No such file or directory

Any suggestions on how to delete this file?

Edit:

[root@testserver backup]# find ./*use-compress-program* | od -c
0000000   .   /   -   -   u   s   e   -   c   o   m   p   r   e   s   s
0000020   -   p   r   o   g   r   a   m   =   p   i   g   z  \n
0000036

[root@testserver backup]# ls -l
total 330929080
-rw-r----- 1 root root 243887951248 Apr 20 08:34  backup.tar.gz
-rw------- 1 root root  93746165248 Apr 20 08:46  backup2.dmp
-rw-r----- 1 root root    293076992 Apr 19 16:52 '--use-compress-program=pigz'
  • 1
    *If* the name in question is `--use-compress-program=pigz` then it's a duplicate of this question: [*what if a file is named minus something?*](https://superuser.com/q/419964/432690) The single-quotes may be because [your `ls` prints this name with single-quotes](https://unix.stackexchange.com/q/258679/108618). But if the name is literally `'--use-compress-program=pigz'` then you need to take these quotes into account. What is the output of `find ./*use-compress-program* | od -c`? Please [edit] and add this information. – Kamil Maciorowski Apr 20 '22 at 05:42
  • Edited, thanks. – postgresnewbie Apr 20 '22 at 05:48
  • Did you try surrounding the whole thing is double quotes? – davidgo Apr 20 '22 at 07:01
  • It didn't work but i tried @KamilMaciorowski's link and solved the problem. – postgresnewbie Apr 20 '22 at 07:08

0 Answers0