Not able to input \ backslash when vi editor

Hi,
How do I input \ when I do a vi of my file ? I try to input the \ but it came out as @.
Appreciate any help.

That really depends on your terminal settings and having your keyboard set up normally or correctly:

On MacOX

$ vi test.text

(type \\\\\\\ in terminal)

$ cat test.text

\\\\\\ 

$ 

Works fine for me on MacOS... now try Linux:

$ vi text.text

(type \\\\\\\ in terminal)

$ cat text.text
\\\\\\\
$

Sounds like your keyboard may not be mapped properly, that is the first thing that come to mind.

Hi, I have installed the Solaris 11 on a Oracle VM box. How do I do the mapping of the backslash ?

Maybe this will help you:

REF:

6.15 Non-US Keyboard Mappings Not Reliable in Virtual Machine Console

Also, consider these examples for Solaris 11 timezone and keyboard settings:

Install nlsadm for easier management of national language properties (Solaris 11.2)

# pkg install nls-administration

Get current configuration

# nlsadm get-console-keymap
# nlsadm get-system-locale
# nlsadm get-timezone

List available timezones

# nlsadm list-timezone

List available console keymaps

# nlsadm list-console-keymap

List available locales

# nlsadm list-locale

Set timezone to Europe/Berlin

# nlsadm set-timezone Europe/Berlin

Set locale to de_DE.UTF-8

# nlsadm set-system-locale de_DE.UTF-8

Set console keymap to UK-English

# nlsadm set-console-keymap UK-English