I create a file name
:~ on bash shell by accident
scp foo :~
How to delete it?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
rm ':?' or
rm ":?" or
mainly you need to quote the file name either with single quotes or double quotes. Or escape any special characters contains in files name.
some special characters I can count are:
* $ & - ; space/tabs \ brackets/parenthesis/brackets ? etc
I suggest to use single quotes to prevent deleting a wrong file named
my_file instead of
rm $file or
rm "$file" when