Oracle DBA, How To, Error, Cause and Action

Showing posts with label Unix / Linux Command. Show all posts
Showing posts with label Unix / Linux Command. Show all posts

vi Editor

Just remember that there are two modes in vi editor

1. Command Mode
2. Insert Mode


Command Mode

Once the file is opened, you are in command mode. From command mode, you can:

- Invoke insert mode
- Issue editing commands
- Move the cursor to a differ ent position in the file
- Invoke ex commands
- Invoke a Unix shell
- Save or exit the current version of the file


Insert Mode

In insert mode, you can enter new text in the file. Press the Escape key to exit insert mode and return to command mode. The following commands invoke insert mode:

a Append after cursor.
A Append at end of line.
c Begin change operation.
C Change to end of line.
i Insert before cursor.
I Insert at beginning of line.
o Open a line below current line.
O Open a line above current line.
R Begin overwriting text.
s Substitute a character.
S Substitute entire line.


Example

I want to create file in /tmp with filename my_first.txt
The content of the file is simple words hallo world

1. type vi /tmp/my_first.txt




2. When you hit enter you will be in Command Mode of vi editor


3. From Command Mode you can type "i" to go to Insert Mode as you can see from the bottom is written "INSERT"
you can start type into the vi editor.



4. After you complete the editing press "ESC" to go back to Command Mode, as you can see the word Insert at the bottom is disappear



5. if you want to go back to edit then press "i" and to save and quit from vi editor file type ":wq" and hit Enter.



6. now the file is create and the content is saved.

Draw Calendar With Linux Command

Hallo, Happy New Year 2009, I wish you well and happiness...

Now I would like to share with you how to draw calendar with Linux command or Unix command.

The command is cal

for example you can see calendar for 2009, you type cal 2009




For particular month for example January 2009 you can type cal 1 2009



Ok, that's all happy new year 2009..... :)

Trace command in Unix/Linux

following is the trace command that quite useful during troubleshooting.


Solaris truss

Linux strace

SGI par, or strace available from SGI's Freeware Website

FreeBSD ktrace

BSDI ktrace

HP-UX tusc (not part of main distribution)

Tru64 (Digital) Unix trace (not part of main distribution)