On Tue, Aug 26, 2025 at 8:38 PM joe--- via PLUG-discuss <
[email protected]> wrote:

> I have a file that showed up
> in my home directory that I am
> unable to delete, rename, or move.
>
> Any suggestions?
>
> -rw-r--r--   1 joe 242671 Aug 25 16:49 -8071936519780093871.jpg
>
> I tried several ways, including these two:
>
> rm "-8071936519780093871.jpg"
>
> sudo rm "-8071936519780093871.jpg"
>
> Nothing works.
>

If you didn't create the file then how did it get there is a bigger concern
but anyways ...
I suspect the immutable flag is on; trojans typically will prefix a '.' or
a '-' and turn on the immutable flag.

$ lsattr ./-8071936519780093871.jpg  (note the syntax for the filename,
most shells interpret '-' as command switch/option)

if the 'i' flag is *not* set then try
$ rm  ./-8071936519780093871.jpg

if the 'i' flag is *set* then see the example below for a better
understanding of what is going on

<test case>
$ touch \-immutable_file.txt
touch: invalid option -- 'i' (note: the backslash before the '-' is still
interpreted as beginning of 'option' string)
Try 'touch --help' for more information.

$ touch ./-immutable_file.txt   (relative path name solves the above)

$ lsattr ./-immutable_file.txt
---------------------- ./-immutable_file.txt   (the 'i' flag is not set)

$ sudo chattr +i ./-immutable_file.txt

$ lsattr  ./-immutable_file.txt
----i----------------- ./-immutable_file.txt  (NOTE the 'i')

$ sudo rm ./-immutable_file.txt
rm: cannot remove './-immutable_file.txt': Operation not permitted  (even
root cannot remove the file)

$ sudo chattr -i ./-immutable_file.txt

$ lsattr  ./-immutable_file.txt
---------------------- ./-immutable_file.txt

$ rm  ./-immutable_file.txt  (my rm is aliased to 'rm -i')
rm: remove regular empty file './-immutable_file.txt'? y

$ ls  ./-immutable_file.txt
ls: cannot access './-immutable_file.txt': No such file or directory  (file
is gone)

</test case>

If that doesn't work then use a Live Linux session (any distro will do),
mount the partition and then try to remove it.
You will still need to remove the immutable flag if it is set as shown
above because that flag is set at the file system level.

Let us know your result.

--
Arun Khan
---------------------------------------------------
PLUG-discuss mailing list: [email protected]
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss

Reply via email to