Reputation: 11
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
Reputation: 91017
There are two ways to accomplish your goal:
Use a versioning file system. Then what you want to do happens automatically.
Use a VCS, such as Subversion, Mercurial or Git, and commit after (resp. before) every change.
Upvotes: 0
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
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