user3791256
user3791256

Reputation: 21

how to handle duplicate file(.txt and .txt~) after save file with emacs

Sorry, I have a problem when I try to learn emacs in terminal, when I try to edit 1 file (file.txt) and I try to save this file with C-x C-s. I get 2 files with the same name (file.txt and file. txt~). how to handle duplicate file after save file with emacs on mac osx?

Upvotes: 0

Views: 395

Answers (1)

Drew
Drew

Reputation: 30699

The ~-suffixed file is a backup copy of the file, with the state it had before you started editing.

  • You can disable such automatic backing up.

  • You can also control various aspects of such backing up, including where backup files are to be stored -- see the Emacs manual, node Backup and its subnodes.

  • You can also remove all of the backup files in a directory at once, by visiting the directory using Dired: C-x d. After visiting it, use ~ to mark all backup files for deletion, then x to delete them. See the Emacs manual, node Flagging Many Files.

Upvotes: 4

Related Questions