Command Line Arguments – Shell Scripting

March 26, 2012

$# holds number of arguments specified on command line. And $* or $@ refer to all arguments passed to script.


Vim Commands – inserting and overwriting text

March 26, 2012
Inserting and overwriting text
Vim command Action
i Insert before cursor.
I Insert to the start of the current line.
a Append after cursor.
A Append to the end of the current line.
o Open a new line below and insert.
O Open a new line above and insert.
C Change the rest of the current line.
r Overwrite one character. After overwriting the single character, go back to command mode.
R Enter insert mode but replace characters rather than inserting.
The ESC key Exit insert/overwrite mode and go back to command mode.

Vim Commands

March 26, 2012
Deleting text
Vim command Action
x Delete characters under the cursor.
X Delete characters before the cursor.
dd or :d Delete the current line.

Vim commands

March 26, 2012
Vim command Action
j or Up Arrow Move the cursor up one line.
k or Down Arrow Down one line.
h or Left Arrow Left one character.
l or Right Arrow Right one character.
e To the end of a word.
E To the end of a whitespace-delimited word.
b To the beginning of a word.
B To the beginning of a whitespace-delimited word.
0 To the beginning of a line.
^ To the first non-whitespace character of a line.
$ To the end of a line.
H To the first line of the screen.
M To the middle line of the screen.
L To the the last line of the screen.
:n Jump to line number n. For example, to jump to line 42, you’d type :42

Count the number of users

March 26, 2012

who | wc -l

who will give the list of the users and wc -l will count the number of lines(users).

Version Control

March 22, 2012

The Subclipse project integrates support for the Subversion version-control system with Eclipse’

a) Adding a new project to the subversion repository (Team->Share Project)

b) Updating a project (Team->Update)

c) Adding a new file :  If you add a file to your project, it’s not automatically part of version control — you need to specifically add it to the repository(Team->Add to version control).

d) Deleting a file : Subclipse flags the file for deletion automatically and removes it from your project.

e) Ignoring files : Right-click the file or directory you want to exclude from version control, then choose Team > Add to svn:ignore to display the Add to svn:ignore dialog.

f) Commiting your changes : Be sure to update your project (see “Updating a project”) before attempting to commit your changes. Right-click the project and choose Team > Commit from the menu.

g) Main difference between branch, tag and trank given in stack overflow.

Reference :