1

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#?

Sahand
  • 111
  • 1
  • 3
  • Try rm '#korpus.txt#' from the command line. Sometimes files with funny characters in their names are better addressed by enclosing their names in ''. –  Dec 14 '15 at 16:40
  • I'm closing this as a dupe since all the answers of the duplicate also apply here, despite this being about a different problem character. – terdon Dec 14 '15 at 23:47
  • Emacs buffers are just internal to emacs. kill-buffer (C-x k) will not delete a file. You need to use delete-file or dired or some other method to delete a file from emacs. The file is probably an autosave file that emacs creates. Search for how to configure autosave to prevent its creation. – jpkotta Dec 15 '15 at 00:28

2 Answers2

3

You could run:

rm '#korpus.txt#'

Quoting will prevent your shell from interpreting # as a start of comment character.

However, if this file is being held open by some process, deleting it will do you no good (the space it occupies will not be reclaimed). It may be best to use fuser on this file to find out whether it is in fact open.

dhag
  • 15,736
  • 4
  • 55
  • 65
2

You could also run:

rm \#korpus.txt#

Some good information to know before you blow that file away. Pound signs "#" before and after a file, are usually "auto-save" files.

IT_User
  • 362
  • This is useful for removing all files that begin with #, since you can't use the wildcard character * in that way with quotes. – Max Candocia Feb 21 '18 at 16:29