UNIX Basis VI Editor and System Management

xiaoxiao2021-03-06  44

Http://onyxluo.myetang.com/unix/base2.htmlunix Basis VI Editor and System Management

Vi Editor

Any user's most frequently do what is most often created, including documents, reports, and text, VI (Visual Editor)

One

Effective and relatively simple full screen editing, using VI, just remember a small amount of basic instructions, you can start starting, then learn

other

More complex instructions, and system administrators use VI management and maintenance systems. VI is included in the SCO System V job system

middle

Full screen editing, in fact, VI is not alone in SCO UNIX, but is quite popular in UNIX. Open file

regardless

It is a new file or modify the old file, you can use VI, the required instructions are:

$ vi filemane

If the file is new, you will see a message at the bottom of the screen and tell the user that you are creating a new file. If the file has already been

exist,

VI will display the first four lines of the file, the user can use the cursor (CURSOR) to move files.

This is what vi looks like.

~

~

The above is an analog file opened by a VI, and the row number (~) indicates the end of the file. Document and plug

Incoming state

VI uses two states, one is a command mode, and the other is an insert mode. Vi

Referring to

When the description, the incoming content will be regarded as an instruction; on the other hand, when the VI is inserted, it can be entered into the body (

TEXT)

Give the file. Most VI instructions are single characters, changed by the insert state to the directive state, refers to the key; and by the command state to plug

Incoming state

You can use the following insertion order, directly to enter, no need to press key.

- Instruction I insert the text in the cursor

- Instruction I Insert the body in the beginning of one line

- Directive A added textures after the cursor

- Directive A adds the body at the end

- Directive o Newly opened in the cursor

- Directive o Newly opened on the cursor

To remember a little, inserted into the state, you can't get into the instruction, you must press button first, return to the instruction. If you don't know

What is

Sample, you can also press key, no matter where it is, it will return the instruction state.

Archive and exit

How to archive and exit the specified file is important when modifying the file. In VI, exercise an archive or exit instruction,

First

Press the colon (:), change to the directive state, the user can see the lower left of the screen, there is a colon (:), showing VI already

Change to

The directive state can be archived or exited. Below is some commonly used instructions in this regard.

: q! Give up any changes to exit VI, which is forcibly exiting

: w Archive

: WQ archive and exit VI

: X is the same as WQ

: ZZ deletes the body like WQ

Deleting or modifying the body is using the insert state, so the instructions mentioned below simply select instructions directly in the insert state.

I.e.

-X Delete Cursor Character (Character)

-Nx deletes n characters after the cursor

-Nx deletes N characters before the cursor

-Ndw Delete Cursor N word (Word)

-DD ​​delete

-D $ or D Delete by the cursor to the end of the line

-U Restore the previous time to delete

Modify the body

When using the VI to modify the body, when adding minimal, another set of instructions inserted into the state will be employed. - R char Reck by char than the character in the cursor

-Rtext Character in the cursor by Text

-CWText Words from TEXT replacing the cursor

-Ctext is at the end of the row by Text replacement cursor

-Cc makes the whole line blank, but retains a cursor position, let you start to enter

- If you delete an instruction, the number of imported before the command indicates how many times is executed.

Text mode search

To retrieve files, you must do it in an order state. The so-called "mode" is a specific string, which can be spaced.

.

- / str Search the STR until the end of the file

-? Str Search STR from behind until the file is opened

-N repeated retrieval in the same direction

-N repeated retrieval in the opposite direction

-Vi winds the entire file, constantly retrieve until the next appearance appears to match the pattern.

other

If you want to execute during the VI execution, use an exclamation mark (!) To execute system instructions, such as during VI, column

Out of the current directory, you can get it

:!

On the other hand, the user can create a .exrc environment file in the primary directory, use the set to enter the option, each time the VI is called,

Read the instructions and settings in .exrc. Here is an instance of the .exrc environment file:

SET WRAPMARGING = 8

SET ShowMode

Set autoindent

Set number

System Management

This time I have to talk about the system administrator to manage the SCO UNIX system, with unique registration name - ROOT, you can read any

what

Files, write, and delete any files, perform any utilities and instructions, or terminate any user program.

system

The work of the administrator includes the system controlled task, such as the latter to lock and unlock the terminal and the account number, increase, retreat and withdraw.

Dispense

user. You can also give users some privileges to make them realize privileged system tasks.

Basic directive

The basic data structure of the shell instruction is file, so the basic instructions and operations contain the following functions:

- Directive in display and management files

- Directory for the management directory

- Input Output Redirection and Pipe, Redirect Standard I / O, and Perform Combination Directive $ W | GREP 'JOHN'> John, Fi

le

- Output Redirector (>) Redirects the standard output to the file

- Enter a redirector (<) input standard input redirection from file input

- Pipes (|) Redirect the standard output to other instructions

Find files

The Find (c) instruction can look for files in the hierarchical directory, for example:

$ FIND / -NAME FileName -Exec RM {};

-Name filename Specifies FileName

-EXEC RM indicates that this instruction is executed in the file found.

In addition, the user can also join, -print expression, display the full path name of the file. In addition, Find (c) also

can

For the files held by specific users or users, such as:

$ FIND / -USER BIN -PRINT

$ FIND / -GROUP MMDF -PRINT

Alternatively, re-directed the filter with Find (c), output an error message, for example: $ find / -name motdd -print 2> / dev / null

SCO shell

With the SCO shell, you can make the user select the application, manage files, and directory, run system utility from a single menu.

Order, to call the SCO Shell, type:

$ SCOSH

You can use the napkock or arrow key to move the cursor, highlight the selected menu item

- Press

Go back to the previous level, or give up the current operation

- Press

Display the available option table in the field

- Press V to select each item in the field option table

- Press

Display help information

- Press Quit or to exit the SCO Shell

System management shell

Need to call the system administrator shell, it should be entered:

$ SYSADMSH or $ SCOADMIN

Although each user can call SysadMSH, only the user can implement the privileged management task. base

this

On, how is the method of use and SCO shell, but only a few function keys, such as

Search, Change Directory and Perform format. Moreover, SCOADMIN can be more in the XWindow graphical environment.

OK, users find different management tasks on the logs (LCON).

Multi-registration screen

On the console, users can allow users to have up to twelve different registration snows. Multi-the-shipment system administrator can

Perform a few tasks. When the system starts, the multiple screens on the console will automatically act. Press buttons at the same time and

to the function key to implement the conversion between the screens. As for, on the terminal, start multiple registration screens, then available

Mscreen utility, for proper work, Mscreen requires TTY. For example, start two firefly, should be entered

$ Mscreen-n2

Then press the button and the or key, conversion between two screens, when logging out, make sure all screen injections

pin

转载请注明原文地址:https://www.9cbs.com/read-61190.html

New Post(0)