The 3rd example you showed where you're attempting to
rm the file looks to have the
rm command overloaded with a sequence of commands, one of which, attempts to do a
mv of the file to
[martin@A08-R32-I196-2-FZ1RLP2 anaconda3]$ rm test2.ipynb
mv: cannot create regular file ‘/export/.trash/test2.ipynb’: Permission denied
Look at the permissions for
$ ls -ld /export/.trash
Everything should be owned by your user 'martin' so that this account can delete files and optionally
mv them to this directory.
I suspect someone used the
sudo command when working in this directory and, perhaps accidentally, set the permissions of the
.trash directory so that root owns it.
rm command. You can check if it's been overloaded as an alias or a shell function with the same name using the
type command. Examples:
$ type -f rm
rm is aliased to `rm -i'
$ type -f mv
mv is aliased to `mv -i'
Here we can see that the
rm commands have been overloaded as aliases to
mv -i and