July 2009
The Archives
-
07.13.09OR in grep$ egrep "regexp1|regexp2" file1 file2 Search one or more files (file1 and file2 in our example) for lines that match any of several (two in our case) regular expressions: regexp1 OR regexp2. The '|' stands for the OR.
-
07.10.09Adding password protection on a file with vim$ vim -x filename The -x option uses encryption when writing the file. It will ask for a key: Enter encryption key: ****** Enter same key again: ****** From then on your filename will be encrypted and accessed using the password. The -x option will no longer be necessary when editing the file.
-
07.04.09Vim. Inserting textProbably, the most important action to do with a text editor is inserting text. Vim makes this task very easy and powerful at the same time. Before we start, let us specify some symbolic conventions: I will use ESC and ENTER to refer to the escape and ENTER keys respectively All the keys you are expected to press without producing any output on the screen will be in boldface. Example: ESC i means you have to press escape and then i, i being a command that does not produce any output Let us start with vim: $ vim test.txt The simplest way of inserting test ...