I am using SSH to another terminal with very limited disk space. upon typing ls I see a file called #korpus.txt#. I suspect this file is an emacs buffer, but upon running emacs and trying to kill it with C-x k bufname RET, it isn't found. How can I remove #korpus.txt#?
3 Answers
rm '#korpus.txt#'
solved the problem. The quote marks are necessary for escaping the #. Did not try Class Stackers solution.
Some other methods to delete oddly-named files, though less optimal than those previously described, can get you by in a pinch:
Careful use of wildcards:
rm -i ?korpus.txt?
Try using filename completion. In bash:
rm #
tab changed torm \#korpus.txt#
Try using a different shell just for the task.
/bin/tcsh
had no issue withrm #korpus.txt#
Since you added tag emacs
, here is the Emacs way to do it:
In Dired (C-x d
):
Type
#
to flag all such files for deletion (markD
).Then type
x
to delete them all.
missing operand
#
needs to be escaped.rm \#korpus.txt\#
is what you need to do. @WillP.'s answer did not mention this.