Bubbles Bubby
Bubbles Bubby

Reputation: 11

Checking contents of a file before it was modified in linux

I wanted to know if there was any way to check the contents of a file before it was modified in linux. As in suppose i have a file called example.cpp where i have a C++ code written in it. Now if i made some changes and saved it, is it possible to check the older example.cpp file without the changes made?

Thanks in advance

Upvotes: 0

Views: 202

Answers (3)

glglgl
glglgl

Reputation: 91017

There are two ways to accomplish your goal:

  1. Use a versioning file system. Then what you want to do happens automatically.

  2. Use a VCS, such as Subversion, Mercurial or Git, and commit after (resp. before) every change.

Upvotes: 0

suspectus
suspectus

Reputation: 17258

No it's not possible. Linux does not store versioned copies of files.

What you can do is store your source files in a source control system such as git, subversion or cvs. These provide full versioning of all files stored within their repositories.

Upvotes: 1

Frank Kusters
Frank Kusters

Reputation: 2634

The file system does not make backups or do versioning. However, some editors make backups before saving. At least Gedit saves a backup of example.cpp as example.cpp~.

Upvotes: 0

Related Questions