Oops - I typed ci not vi, and have lost my file ...
Sitting writing late at night, I occasionally misspoll something; no great problem - I can go back and correct it, or if I fail to do so occasionally my kind reader will work out whaT I mean and forgive. But occasionally, when I'm typing in commands at the command line, one character can cause a big problem. Let's say I typed "ci" rather that "vi":
munchkin:fppy grahamellis$ ci demo
demo,v <-- demo
enter description, terminated with single '.' or end of file:
NOTE: This is NOT the log message!
>> Err ...
>> .
initial revision: 1.1
done
munchkin:fppy grahamellis$
And that's an easy mistake to make - with "c" and "v" next to each other on the keyboard. And - oh dear - the "demo" file has gone!
munchkin:fppy grahamellis$ ls demo
ls: demo: No such file or directory
munchkin:fppy grahamellis$
Blind panic? Perhaps so, the first time ... but fear not. You have called up RCS - the "Revision Control System" and
Checked
In the file called demo. You'll have a file called
demo,v in your current directory, and you can use the
co command to get a copy out; you'll then probably need to use
chmod to get set the permissions on the file and make it writable again.
Note - my example is Mac OS X; some versions of ci don't even prompt for a description and you just appear to loose your file. It's also possible that you system / RCS has been configured to save the ,v files elsewhere, so you may need to use find to find them. (written 2011-02-21, updated 2011-02-24)
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
G996 - Well House Consultants - Newsletter Scripts [1001] .pdf files - upload via PHP, store in MySQL, retrieve - (2006-12-19)
[1066] Final, Finally and Finalize - three special words in Java - (2007-02-05)
[1123] mysqldump and mysqlrestore - (2007-03-30)
[1217] What are factory and singleton classes? - (2007-06-04)
[1321] Resetting session based tests in PHP - (2007-08-26)
[1387] Error logging to file not browser in PHP - (2007-10-11)
[1487] Efficient PHP applications - framework and example - (2007-12-28)
[1505] Script to present commonly used images - PHP - (2008-01-13)
[1601] Replacing the last comma with an and - (2008-04-04)
[1665] Factory method example - Perl - (2008-06-04)
[1743] First class functions in Lua lead to powerful OO facilities - (2008-08-07)
[1813] Ajax - going Asyncronous and what it means - (2008-09-28)
[1954] mod_rewrite for newcomers - (2008-12-20)
[2046] Finding variations on a surname - (2009-02-17)
[2145] Using the internet to remotely check for power failure at home (PHP) - (2009-04-29)
[2259] Grouping rows for a summary report - MySQL and PHP - (2009-06-27)
[2360] Error Handling in Lua with assert and pcall - (2009-08-13)
[2433] Controlling, supressing, enabling PHP error messages - (2009-10-02)
[2539] Changing Images - (2009-12-17)
A101 - Web Application Deployment - Linux -An Introduction For Users [73] vi - full circle - (2004-10-04)
[74] pushd and popd - (2004-10-05)
[152] Aladdin, or careful what you wish. - (2004-12-15)
[249] An easy way out - (2005-03-17)
[430] Linux commands - some basics - (2005-08-31)
[431] File permissions of Linux and Unix systems - (2005-08-31)
[593] Finding where the disc space has gone - (2006-02-06)
[659] Web Application Components - (2006-03-28)
[679] More or less on the edge of the page - (2006-04-11)
[703] Copying files and preserving ownership - (2006-04-28)
[710] Linux training Glasgow, Python programming course Dundee - (2006-05-05)
[711] THE home directory or MY home directory - (2006-05-06)
[749] Cottage industry or production line data handling methods - (2006-06-07)
[984] Cardinal numbers and magic numbers - (2006-12-14)
[1012] Moving files between Windows / DOS and Linux / Unix - (2006-12-30)
[1013] Copy multiple files - confusing error message from cp - (2006-12-30)
[1068] ls -l report, Linux / Unix - types and permssions - (2007-02-06)
[1259] Where am I and how did I get here? - (2007-07-05)
[1287] Work and play at Well House Manor - Football and Shell Shortcuts - (2007-08-02)
[1288] Linux run states, shell special commands, and directory structures - (2007-08-03)
[1366] awk - a powerful data extraction and manipulation tool - (2007-09-25)
[1408] Wireless hotel tips - FTP and Skype connections failing - (2007-10-26)
[1438] Copy and paste / cut and paste and other vi techniques - (2007-11-20)
[1527] Selecting file names in a shell - one word or another - (2008-02-02)
[1651] ls command - favourite options - (2008-05-23)
[1764] Yank and Push - copy and move in vi - (2008-08-21)
[1803] FTP passive mode - a sometimes cure for upload hangs - (2008-09-20)
[1893] Some Linux and Unix tips - (2008-11-18)
[1897] Keeping on an even keel - (2008-11-21)
[1902] sstrwxrwxrwx - Unix and Linux file permissions - (2008-11-23)
[1904] Ruby, Perl, Linux, MySQL - some training notes - (2008-11-23)
[2201] Running straight from the jar, but not from a tar - (2009-05-26)
[2203] Always use su with minus. And where do programs come from? - (2009-05-27)
[2299] How much space does my directory take - Linux - (2009-07-20)
[2300] What does x on a linux directory mean? - (2009-07-21)
[2479] Accidentally typed ci rather than vi? - (2009-10-27)
[2494] Making Linux Politically correct - (2009-11-06)
[2636] Linux - useful tips including history and file name completion - (2010-02-15)
[2831] Recording (a macro) in vi - (2010-06-27)
[3256] Displaying a directory or file system tree - Linux - (2011-04-22)
[3791] The Kernel, Shells and Daemons. Greek Gods in computing - (2012-07-01)
[3819] Packing a tar, jar or war file - best practise - (2012-07-26)
Some other Articles
Redevelopment on the banks of the Avon in MelkshamWhat we look for in a lunchtime cafe restaurant in MelkshamBeware - a=a+b and a+=b are different - PythonAge limits for Well House Consultants Open Source courses?Oops - I typed ci not vi, and have lost my file ...The cost of roadworks on the economy of our town - 1800 pounds per hour?Insurance against any errors - Volcanoes and PythonComparing German, Dutch and British RailwaysThe Rhine in winterSharing a single hotel internet connection without carrying extra hardware