Huawei's SCO UNIX training materials (already said)

xiaoxiao2021-03-06  115

Huawei SCO UNIX training materials found online, everyone took its essence.

http://www.chinaunix.net Author: ltj-1210 Posted: 2004-02-23 16:19:26

2.3 UNIX command

First, UNIX command format

1, UNIX command prompt

At the command line, the operating system displays a prompt, prompting the user to enter a line of commands after this prompt. Different shells have different default prompts:

B shell and k shell default prompts are "$";

The default prompt of C shell is "%";

However, when logging in with a root user, the system prompt is unified to be "#".

Users can change their default shells and prompts.

2, basic command format

Under the shell prompt, you can enter the UNIX command. The basic format of the UNIX command is as follows:

Command parameter 1 parameter 2 ... parameter N

The UNIX command consists of a command (Command) and zero to multiple parameters, commands and parameters, and between parameters and parameters separated by spaces. The Unix command format is similar to the DOS command format, but UNIX commands are case sensitive, and the commands and parameters must be separated. Such as: For DOS, the following four commands are the same:

CD / TMP

CD / TMP

CD / TMP

CD / TMP

For the UNIX operating system, the command to change the directory is also a CD command. The following is the correct UNIX CD command:

CD / TMP

CD / TMP

But TMP and TMP are two different directories. The following two commands:

CD / TMP

CD / TMP

It is no longer a CD command.

3, run multiple commands in one line

You can enter multiple commands in a row, and you can use ";" separately, such as:

MKDIR TMP; CP file1 TMP / File2; LS -L TMP

Unix will perform the above three commands sequentially.

4, run the program in the background

Let the program execute in the background, just add "&" symbols on the command line.

[Example 1] Run the Find command in the background, find the file name ABC in the current directory and its suburveus.

The content executing command and immediately displayed is as follows:

$ FIND. -NAME ABC -PRINT &

10722

$

...

10722 Represents the process number (PID). When the find command is executed in the background, the result is displayed.

When the command is run in the background, it is best to redirect its output to a file for later check.

[Example 2] Run the find command in the background, find the file name ABC file in the current directory and its suburveus and save the result to myfind file.

The execution command is as follows:

$ FIND. -NAME ABC -PRINT> MyFind &

You can continue to enter the command while running the background program.

5, nohup command

When the terminal exits, the background program started by the terminal automatically exits. If you want the terminal to exit, the program does not stop running, then start the background program with the nohup command. If the command is added to the example 2, the NOHUP is changed to:

$ nohup find. -name abc -print> Myfind &

Second, special buttons

There are some special keys in the UNIX command operation, the list is as follows:

Ctrl D end keyboard input or exit the current shell

DEL interrupt key, stop the current action back to Shell

Ctrl S pause screen output

Ctrl Q continues the screen output

Ctrl U Kill button, delete all characters in the row of cursor

ESC ends the current operating status (such as VI)

Third, UNIX commonly used simple commands The following table lists several simple unix commands:

Interpretation Unix Command Command Example

View Help Man Man Date

View Date Date Date

Show Calendar Cal Cal 1998

Show uppercase big characters banner banner "abcd"

Calculator BC BC

Modify Passwd Passwd

View Who is using the system who who

View I who am I who am i

Display User Information Finger Finger User Name

Clear screen Clear Clear

1, MAN Command - View Help Information

Example:

View MAN's How to Use: Man

View finger command help: man finger

2, date command - display, modification date and time

The command to display is as follows:

date

The display is as follows:

Mon aug 17 13:43:14 NST 1998

Represents NST standard time, August 17, 1998, 13:43:14, Monday.

3, CAL command - display calendar

Example:

Display 1998 Year Calendar: CAL 1998

Show August 1998 Calendar: CAL 8 1998

4, banner command - show uppercase big words

Example: Use the big words on the screen to display "Huawei", the command is as follows

Banner "huawei"

5, bc command - simple calculator

The BC command can be added, reduced, multiplied, divided, moderate, multiplication, operators are " " "" * "" / "" "" "" "". BC use examples are as follows

BC

Enter the calculation in the future, such as:

1234 * 3 2 ^ 4

Press the carriage return to the result, wait for other calculations. Press the D key to exit the BC.

6, passwd command - modify password

To modify your own password, just run:

Passwd

The system will prompt to enter the original password and enter a new password.

7, who command - View users who are using UNIX

Usage is as follows:

WHO

The system will display the username, terminal number, and login time using UNIX. To view the user's own information, run:

WHO AM I

8, finger command - display user information

The finger command is larger than the WHO command, and the function is strong. Basic methods are as follows:

Display login information: finger

Show smith users Details: finger smith

9, clean command - Clear screen

Clear

Fourth, Unix users simple communication command

UNIX provides a number of ways to communicate with each other, which allows you to send and receive information in text. You can transfer information to other users, all users, or yourself. The source of information can be a text file or directly entered by the keyboard.

(1) WRITE command

You can send a message to another user that is logged in to another user, and communication between the two sides when the other party uses the Write command.

When the user uses the WRITE command, the prompt information is displayed on the other user terminal. The format of the Write command is as follows:

Write destination-user [Terminal]

Among them, Destination-User is the user registration name you want to communicate with, usually use the who command to view its registration name. If the other party is logged in on multiple terminals, you can control Write's packets to the specified terminal by using Terminal. In order to establish two-way calls with other users, users and each other must execute the write command each time, and must specify the registration name. Generally, when using UNIX, the communication between the communication has some conventions: use "O" to end a message, "oo" means ending this communication, with Ctrl-D exiting the Write command. [Example 1] Two users on UNIX Alex and Jenny communicate through the write command.

On the terminal of Alex () is sent Enter:

$ WRITE ALEX

Hi alex, are you there? O

Message from Alex (TTY11) [SAT JAN 5 15:08] ....

YES JENNY, I'M HERE. O

......

Thank you, Alex, BYE! OO

Ctrl-d

$

This example shows the communication process of Alex and Jenny using the Write command. First, Jenny sent a message to Alex to Alex using the first two lines. The next two lines were received Jenny received, and the omitted number indicated that their communication continued. Finally, Jenny uses Thank you, Alex, Bye! OO tells Alex not to say, and start typing Ctrl-D in the next line to exit Write and return to the shell.

(2) Dialogue using Talk

The Talk command is a virtual communication command that allows the login to both sides to convers in real time through the keyboard, and its format is as follows:

Talk User-name [Terminal]

Note that the machine architecture used in both parties must be the same when performing both parties. When the other party gives the response Talk command, both parties have shown

[Connect ESTABLISHED]

When both parties can communicate with duplex. Both sides can enter from the keyboard at any speed, Talk puts your input a row on the screen of you and the other party. Use to exit Talk.

(3) Use MESG rejection and allow reception of packets

The MESG command allows or rejects the WRITE and TALK communication information sent by other terminals. The MESG command runs in the local terminal, and its format is as follows:

MESG [Y] [N]

Where Y indicates that the reception is allowed, n means a refusal to receive. If Y is not given n, it is reported that the current license state is reported. example:

[Example 1] Display status:

$ MESG

The result of the command is:

IS Y

Or is n

[Example 2] Refused to receive WRITE and TALK communication information sent by other terminals:

$ MESG N

$ MESG

IS N

(4) WALL broadcast message delivery

All login users can receive this message. Only superusers use this command. The Wall command has the following formats:

# wall

# wall filename

# Wall "Send a message to all the people."

2.4 Logout (exit UNIX system)

After each use, you must cancel it to prevent others into the system through your account and ensure the integrity of the system. The cancellation process is as follows: At UNIX prompt, run:

$ EXIT

or

$ logout

Or direct buttons: Ctrl D.

Due to the difference in UNIX operating system, the logout command may also be different.

[Posted Reply] [View the original post] [Add to Favorites] [Close]

-------------------------------------------------- ------------------------------

LTJ-1210 Reply to: 2004-02-23 16:23:19

3.5 Unix File Access Permissions

First, access access rights

There are three permissions for UNIX files:

Access permission for access rights directory of permission ordinary files

R has the right to read the file to read the file name

W has the right to write files to establish and delete files, you can change the file name

X Rights with execution files can use files in this directory (such as CD commands) search file, etc.

Second, you can access the user type of the file

Three types of users can access files:

User type description

The owner of the Owner file (owner)

Group user group

Other users (non-Owner and non-Group)

Each type of user has three file access rights: R, W, X.

Third, the display of file access rights

You can display the "ls -l" command, such as:

$ ls -l file1

The display is as follows:

-rwxr-xr - 2 wjm newservice 321 oct 17 09:33 file1

Upstream:

The second-4 character "rwx" indicates that this file is the right of WJM on the file file1 rights as "readable, writable, executable";

Article 5-7 Character "R-X" indicates that the user in this user group NewService is:

"Readable, not writable, executable";

The 8-10 characters "R -" indicates that other users have the right to file File1 as "readable, not writable, not implemented"

Fourth, the modification of file access rights

Use the chmod command to modify the access permissions of the file, the format of the chmod command is as follows:

Format 1: Chmod Symbolic_Mode File ...

Format 2: Chmod Absolute_Mode File ...

(1) Format 1: Symbolic_Mode, the symbol mode command format is as follows:

Chmod [Who] OP Permision File ...

The WHO item represents the user type, its content is one or more of the following:

U file owner (user --- oowner)

G User Group (Group)

O Other people (other)

A owner (all)

OP item representation:

Express the right to add Permission specified

- Indicates the right to cancel the permission specified

The Permission item is access permissions, and its content is one or more of the following:

R represents readable

w represents writing

x represents executable

Example:

Chmod U W Test Report The owner "writable" for TEST and REPORT files

Chmod U-X Abc.c The owner is unauthorized on the ABC.C file

ChMOD U RWX MyFile1 owner is "readable, writable, executable"

Chmod ugo rwx myfile2 Anyone is "readable, writable, executable"

(2) The format 2: Absolute mode (absolute_mode), the command format of the symbol mode is as follows:

Chmod XYZ File ...

X, Y, Z is 0-7 number, respectively, indicate the host, user group, and others to access the file. The value formula of x, y, and z is:

A * 4 B * 2 C

among them,

A = 1 represents readable, A = 0 means unread; b = 1 indicates that can be written, b = 0 means it;

C = 1 indicates that can be executed, and C = 0 means it is not executable;

Example:

The Chmod 751 NCP owner has "readable, writable, executable" all rights to NCP; members of the member only "readable, executable" rights; other users have only "executable" rights to NCP.

V. Change the group owner and document group

Change the format of the file owner as follows:

CHOWN master name file name

The owner of the file must be changed to the file with WRITE rights.

The format of the group where the file is located is as follows:

CHGRP group name file name

Must be the owner or Supervisor of the file to change the home of the file group.

Example:

Chown WJM Test1 change the owner of the file TEST1 to WJM

CHGRP NewService Test1 change the user group of the file test1 to NewService

3.6 Unix redirection and pipeline

UNIX redirects the standard output of the file to the file or the standard input of the data file as another program. The redirect symbol is as follows:

> Redirection output

>> Redirection output and append to the tail

E.g:

Ls -l> file1 stores the content displayed by the ls -l command to File1,

Ls >> file1 attached the content displayed by the ls command to the end of the end1

GREP ABC

Among them, ">" >> ""> "to save the output content to the redirect file, if the file exists, first delete the original content;" >> "save the output content to the weight The tail of the orientation file.

The Unix pipelines the output of a file as the input of another file. The pipeline symbol is as follows:

| Output of the left command as the input of the right command

E.g:

LS | More will output the LS output as an input of more commands

PS-EF | GREP Smith PS-EF Output as the input of GREP SMITH commands

3.7 Unix file system common command

UNIX Command UNIX Command Example Similar to DOS Commands

Show current directory PWD PWD CD

Change the directory CD CD / USR CD C: / usr

Enter Home Catalog CD CD

Create a directory MKDIR MKDIR ABC MD ABC

Delete empty directory RMDIR RMDir ABC RD ABC

Delete the directory and its content RM -R RM -R ABC DELTREE ABC

Display Directory Contents LS LS Abcls -l ABC (File Long List) LS -A ABC (All Type Files) LS -D * (Not Subcapacity) DIR ABC

Display text file content Cat cat file1.c type file1.c

One screen display text file content more more file1.c

Copy file cp cp file1 file2 copy file1 file2

Mobile (rename) file MV mv call.test call.list move call.tst call.lstren call.test BBB

Delete file RM RM Call.list Del Call.lst

First, PWD command

Use the PWD command to display the current directory path, the command is as follows:

PWD

Second, CD command

The CD command is used to change the current directory, such as:

Command example

CD / usr / smith changes to / usr / smith directory

Cd ../wjm changed to the WJM subdirectory under the parent

CD Exam1 changes to the exam1 subdirectory CD in the current directory to change to home directory

The CD command without parameters indicates that you have an essential difference from DOS.

Third, RM command

RM commands can delete files and directories, as follows:

Command example

RM file2 deletes file file2 in the current directory

RM file * Delete files starting with FILE in the current directory

RM -R / USR / WJM / EXAM2 Delete Directory / USR / WJM / EXAM2 and its content

Fourth, LS command

The ls command can display the contents of the directory, the command format is as follows:

LS - Options file name

The common option is as follows:

-L long list display directory content

-a Displays all types of files, including implies files

-d If the display content contains a directory name, only the directory name does not display the directory content.

Command, for example,:

Command example

Ls show the current directory content

Ls file * Show files starting with FILE in addition to the current directory

LS -L / USR / WJM / EXAM2 long list display directory / usr / wjm / exam2 content

LS -ADL displays the current directory content (at the same time - L, -D, -A parameter)

[Note] The "ls -l" command shows the format as follows:

DRWXRWXR-X 2 Smith Group 48 Jan 05 1998 John

-rwxr-xr - 1 wjm newservice 321 oct 17 09:33 file2

Each line above:

first row:

The first character represents the type of file (D represents a directory, - means a normal file);

The second-4 characters represent the access rights of the file owner on this file (such as "RWX" and "RWX");

The 5-7 characters indicate access to this file (such as "RWX" and "R-X");

Section 8-10 characters indicate access rights to this file (such as "R-X" and "R-");

Among them, the access rights are indicated by three characters, and the order is "RWX", "R" means readable, "w" means

Can be written, "X" means executable. If a prohibited access is "-", such as "R-X" means readable,

Do not be writable, executable;

The second column: The number of links in this file (eg 2 and 1);

Third column: The primary name of this file (such as smith and wjm);

The fourth column: User group name (such as Group and NewService);

The fifth column: the number of items per file (eg 48 and 321);

Sixth to eight columns: The last revised date and time (such as "Jan 05 1998" and "OCT 17 09:33");

Ninth Column: File Name (such as John and File2).

5. MKDIR, RMDIR, CAT, MORE, CP, MV Command

These commands and DOS corresponding command functions and usage are basically consistent, and the correspondence between them and the DOS command is as follows:

UNIX command dos command

MKDIR MKDIR or MD

RMDir RMDIR or RD

Cat Type

More more

CP COPY

MV Move or REN

-------------------------------------------------- ------------------------------ LTJ-1210 Reply to: 2004-02-23 16:25:15

4.1 The most basic usage of the VI editor

The VI editor is a powerful text file editing tool for UNIX, using it to create, modify the text file.

Two state modes commonly used by VI editors

1) Text input method for text input

2) Command mode for input control commands

VI editor

VI file name

Automatically enter the command mode.

Text input method

A will be inserted into the text after the cursor is located (Append)

A will insert the text at the end of the cursor

i will insert text (insert) before the cursor is located

I will insert text before the first non-empty character in the row of the cursor

o Insert the text (Open) will be inserted in the next line of the cursor.

O will be inserted into the text on the previous line of the cursor.

Cursor position movement

h left shift

j

K moving

l right movement

The line number G cursor is moved to a row (such as 1G represents the light sump to the first line)

G cursor moves to the end of the file

Text input mode exit

ESC Press the ESC button to enter the command mode

Delete changes

Run in the command mode.

x Delete the character where the cursor is located

DD deletes the cursor

Exit VI editor

Run in the command mode. Regardless of the state, it is best to press the following ESC button before running the following command to prevent a mistake.

: WQ storage exit

: Q does not store the disk exit

: q! Do not store the disk forced exit

: w only the deposit

4.2 Find files with a FIND command

The Find command finds a specific file that meets the requirements in the specified directory and its subdirectory. The maximum use of this command is to forget the correct location of the file, and want to find the file.

Command format

Find directory name conditions

Directory name --- Directory to start looking for. Find will look for this directory and its subdirectories. There are multiple directory names, as long as the directory is separated from spaces between the directory.

Conditions --- Conditions to search for files, can include file names, home, last modified time, and more.

Condition list description

-Name Name Specifies the file or directory name to be viewed, available in wildcard, such as -name '* .c'

-Print prints out the conditional path

-Size N looks for files that occupy n block

-type x As the file type as a search condition. The file type X is as follows: D --- Directory (Directory), F - Document (File), B --- Block (Block), C - Character, P --- Pipeline (PIPE)

-user user finds files belonging to User, User can be a username or UID number

-group group looks for all files for user groups, groups can be group names or GID numbers.

-LINKS N looks for all files equal to N

-tim n Find files that have been accessed n days

-mtime n Find files that have been modified before days

-EXEC Command {} /; uses the files found as the object to execute Command, {} The parameters required for COMMAND

Conditional logical operator:

Logic Significance Demonstration

! Not! -Name "* .c" all not used .c as an extension file

-o or -size 10 -o -Links 3 files greater than 10block or link number 3

Files with -Size 10-Links 3 greater than 10block and links to 3

Note: " 10" in the above table indicates greater than 10, "- 10" means less than 10.

Basic usage example

Find / Temp -name "abc *" -print Looks for files starting with ABC in / temp directory

Find file named TEST in the current directory 4.3 GREP command basic usage

GREP looks for a specific string in the entire text file and prints all rows of the string.

Command format

GREP string file name

Example

GREP ABCD TEMP Find ABCD Strings in Temp

GREP "this is a book" TEMP Find "this is a book" string in Temp, because the string contains spaces, so you have to enclose

4.4 Compare the file with the CMP command

CMP compares two files, which can be a text file or a non-text file. The CMP command displays two files different from the first time. If two file contents are the same, no information is displayed.

Command format

CMP [-ls] file name 1 file name 2

Parameter Description

-L shows the content of each different byte

-S only shows the return value of the CMP command (the same is 0, which is different from 1)

Example

CMP TEMP1 TEMP2 Compare Temp1 and Temp2 Two Files

4.5 Backup and Recovery Utility

First, TAR command

Use the tar command to include multiple files into a file or disk in a manner. When needed, you can get the required files by the file library. Tar instruction format:

$ TAR [Function-Option [Modifier]] [files]

The TAR command option is divided into two parts: function options and modify options. The function option is used to set a TAR action such as read, write, etc., and modify the option to modify the TAR action. There is no "-" before the TAR command option.

Function-Option:

r Additional files referred to in the file library

x Read files in the file library, such as file names, then the sub-directory will be read (common)

C creates a new file library (common)

g starts with the front of the file by the file library, not written after the last file

Modifying options (MODIFIER):

v Start the display mode, TAR will display the file name (common)

w Start a confirmation mode, before TAR processes each file, ask the user to confirm first

f Represents the file library for File, omit this, with a preset tape or disk (common)

(1) Use the tar command backup

[example 1]

$ TAR CV WORK

In the current directory, back up all files and subdirectories in the Work directory, back up to the default device, and display file information when backing up.

[Example 2]

$ TAR CVF / DEV / RFD0135DS18 WORK

The F option indicates that the default device is not used, and the supplied device is used.

Note: In different UNIX systems, the name of the floppy disk and tape devices is not uncommon. Please pay attention to check when used.

(2) Rehabilitation using tar commands:

[Example 3]

$ TAR XV

X indicates that the file in the default device is restored to the hard disk, and V indicates that the file prompt is displayed when restored.

[Example 4]

$ TAR XV / WORK / AARO1D /WORK /WORK /WORK /WORK /WORK/State.wp

Rehabilitation is more selective, three files are listed here. Note that you must enter the full name of the backup document.

[Example 5]

$ TAR XVF / DEV / RFD0135DS18

Restore files from a given device.

Second, CPIO command

Use the CPIO to get the file or directory from the file library or copy the data to the file library. CPIO instruction format: cpio -i [bcdmrtuv] [patterns]

CPIO -O [ABCV]

CPIO -P [Adlmuv] [DIRECTORY]

Note: CPIO has three basic modes, -O Copy-Out mode, set a set of file copys to a file library, -i, ready-in mode, read file libraries, and expand it in the current directory. -P can read all files from a directory (including subdirectory to another directory) and is not stored in the Archive (archive).

CPIO often works with the shell. -o Common standard input device reads the file name to COPY and outputs COPY's Archive File outputs through the standard output device. Generally utilize the principle of input / output redirection or pipeline, the functionality of true replication is achieved.

(1) Use the CPIO backup:

[example 1]

$ FIND WORK -PRINT | CPIO -OCDV> / DEV / RFD0135DS18

Back up the file in the Work directory to the floppy disk. -o represents the output mode, -c generates a file with header information. -d indicates that the directory is generated as needed, and the -v indicates that the command is constantly displaying information. Use ">" to orient the result to the floppy disk.

[Example 2]

$ LS | CPIO -O> / usr / linfs / old1

Copy all files in the current directory into Old1 Archive File

[Example 3]

$ ls * .c | cpio -o> Oldc

Copy all C procedures in the working directory.

[Example 4]

$ LS | CPIO -P / USR / LINFS / TEMPDIR

Copy files in the current work directory to / usr / linfs / tempdir directory, do not generate Archive File

(2) Rehabilitation using CPIO:

[Example 5]

$ CPIO -ICDV

Restore the files in the floppy disk. -i tells the CPIO to use the file as its input, -d as needed to generate a directory, -v displays all information, -c has a header file format.

[Example 6]

$ cpio -icdv "* stat.wp"

Rehabilitate * stat.wp file

[Example 7]

$ CPIO -I

Only restore * .f file

4.6 file compression and decompression procedure

First, compress compression command

The compress command can compress files to reduce storage space. The compressed file ends with ".z". Expand the command to uncompress. Compressed command format:

Compress filename

Expand the command format is:

Uncompress compressed-filename

[Example 1] Compress and decompress the File file

Compress file

Then the compressed file name is file.z, and the decompression command is:

Uncompress file.z

Second, PACK compressed files

Pack compresses the decompressed file unpack. The name of the compressed file is ".z" The compressed space is fixed due to file type. Command format:

PACK NAME

Unpack name

Note: Pack is not compressed by the pair of files, to force compression, with -f options:

Pack -f name

Third, GZIP compressed file

The decompression file corresponding to the Gzip compressed file is gunzip. The compressed file name is ".gz". Command format:

Gzip filename

Gunzip filename

Fourth, PKZIP compressed file

The decompression file corresponding to the PKZIP compressed file is pkunzip. The compressed file name is ".zip". Command format: PKZIP FileName

PKunzip filename

-------------------------------------------------- ------------------------------

LTJ-1210 Reply to: 2004-02-23 16:30:15

5.1 Unix boot

Take SCO UNIX as an example. The boot process of SCO UNIX is as follows:

(1) Open the SCO UNIX host power supply

(2) Boot: After caught back

(3) Press Ctrl D to enter the multi-user mode, enter the password of the root, enter the single user mode

(4) Enter the date time

(5) "Login:" indicates that SCO_UNIX is successful, and will be logged in later.

5.2 Unix Shutdown Example

The shutdown process of the SCO UNIX host is to type under root:

# shutdown -g0 -y

Indicates that it is turned off immediately. Enter a single user mode by multi-user mode, executing the following command:

# shutdown -g0 -y su

[Note] You must turn off the host power when you run the shutdown command and you have allowed the shutdown information. No information allowed to shut down, do not turn off the host power.

5.3 Modify System Time

The command to modify the system time is as follows:

Date -t ​​199808101536

Change the date to 15:36 August 10, 1998.

5.4 How to Control the Background Process

First, display process information

Unix command explanation

PS displays process information related to terminals

PS -U username shows the process of a user (such as PS -U ABC)

PS -E Displays all running process information

PS -F long list shows each process information

Long List Displays all running process information, the UNIX command is as follows:

PS -ef

Second, use the kill command to kill the background process

Unix command explanation

Kill process number delete process

Kill -9 process number forced deletion process

Third, stop the out-of control process step

(1) Login with ROOT in the terminal unlocked

(2) Find the PID number with the "PS-EF" and "GREP Keyword" command

(3) Kill PID number, if you can't kill, then run "Kill -9 PID"

(4) If you can't kill, then shutdown

5.5 How to view disk usage

Interpretation UNIX command

View Disk Free Space DF -V

View Disk Usage DU [File Name]

5.6 Power-down fault and processing

The system is unexpected, which will result in the following questions:

(1) The file system is destroyed, resulting in loss of file loss

(2) The data in the cache is not written to the disk and the data is lost.

Solve: The system will automatically run the FSCK command after boot, prompt to check whether the / dev / root file system, enter Y check and fix the file system.

The fsck command is used to check and maintain inconsistent file systems. If the system is powered down or disk problems, the FSCK command can be checked on the file system. The command format of FSCK is as follows:

FSCK [-Y] [- n] [- b] [- D] [- f] [fs_device]

among them:

FSCK parameter explanation

-y Answer Y (YES) in the implementation of FSCK, FSCK will correct all errors

-n Answer N (NO) on all issues during the implementation of FSCK

-b If you check the root file system, and cause the file system to change, the system will restart (Reboot)

-D check the broken block

-f Check file system in a quick way

FS_Device describes the special file name relative to the hardware device. If you remove this item, you will automatically check the file system in / etc / checklist file -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------

LTJ-1210 Reply to: 2004-02-23 16:32:40

6.1 TCP / IP protocol

One of the reasons why UNIX systems is widely used in today's world, the Unix's powerful networking feature. UNIX's network protocol defaults to TCP / IP. UNIX has become the preferred operating system for various servers on the Internet.

The TCP / IP protocol consists of a series of protocols, which collectively referred to as the TCP / IP protocol. The TCP / IP protocol is the basic protocol in the TCP / IP protocol, and the common protocols of the protocol are:

l Transmission Control Protocol / Table Network Protocol (TCP / IP - Transmission Control Protocol / Internet Protocol) is the basic protocol of the protocol.

l User Data News Agreement (UDP - User DataGram Protocol) provides a connectionless transport layer protocol, but does not guarantee the reliability of the transfer.

l The remote login protocol (Telnet) is a user layer protocol to define a standard for remote login.

l File Transfer Protocol (FTP - File Transfer Protocol is also the user layer protocol, defining standards for file copy between different systems.

6.2 View online user information

Use the finger command to display user information that is using the UNIX system. The finger command format is as follows:

Finger [User Name] [@ host domain name or IP address]

Finger command example

Command example

Finger View all user information

Finger root View root user information

Finger @ xywsyb2 View all user information on Xywsyb2

Finger abc@xywsyb2.huawei.com View all user information on the host xywsyb2.huawei.com.cn

Finger ABC @ xywsyb2 View ABC User Information on Host Xywsyb2

Finger abc@129.6.114.202 View ABC User Information on Host 129.6.114.202

6.3 Send and receive email using MAIL

The mail command is used to send and receive emails. Users can communicate with users of the system not only using MAIL, but also communicate with users in the network. Two functions of Mail: Send emails and receive emails.

First, send an email

$ Mail Alex

Subject: Test

This Is A Test Message.

Generally use the period to end the letters, some versions end with Ctrl-D.

Second, read email

Mail will display the title of all messages. At this time, the user pressing a one-time reading until all mail is read, type Q to exit and return to the shell.

$ Mail

First, Telnet

Telnet is remotely logged in with UNIX through the network (Tel Remote, NET refers to Network), which is functionally logged in to the remote UNIX host on the local computer used by the user, and treats local computer as a remote Unix host. Simulation terminal. When the user uses Telnet to complete the login of the remote UNIX host, its own computer seems to have disappeared, completely a remote emulation end user of the other host, just like the Unix host terminal. At this point, the functions and resources that the user can use and the entire mode of operation depends entirely on the other party's system and the license account.

The general run format of Telnet is as follows:

Telnet IP address or domain name

The above IP address or domain name refers to the IP address and domain name of the remote UNIX host. The information will appear on the local computer screen, prompting the user to enter UNIX username and password, then request the input terminal type, and finally enter the UNIX system, and the UNIX operating system prompt will appear, and the subsequent operation is like operating on the UNIX host terminal. . When running Telnet under Windows on the PC compatible machine, the terminal type is best to select xterm. [Precautions] The TCP / IP protocol in the local computer and the remote host must be guaranteed before running Telnet.

(3) Run Telnet on Windows 95, log in to SCO UNIX, assuming that the IP address of the SCO UNIX host is 129.6.114.201.

Telnet software is the software that comes with Windows 95, and you can run Telnet as long as the TCP / IP protocol is set. The running process of Telnet is as follows: Click "Start" on Windows 95 to press New, then select "Run" menu, the run box, enter:

Telnet 129.6.114.201

Click "OK" on the Run box to press New, the Telnet box appears, prompt to enter the UNIX username:

UNIX System V Release 3.2 (Xywsyb2.huawei.com.cn) (TTYP2)

Login:

The future operation is like operating on the UNIX host terminal.

[Example 2] Run Telnet on Windows 3.x, remotely logging in to Digital UNIX, assuming that the IP address of the Digital UNIX host is 129.6.5.2.

Since Windows 3.x does not carry TCP / IP and Telnet software, you must install before using Telnet. It does not introduce the installation process here, only introduction of the software's simple settings and use. Netterm software is a variant of Telnet, which fully contains Telnet features, which only introduces Netterm.

Netterm setting: first start netterm, select "Phone Directory ..." in the File menu, appear "Phone Directory" box, enter a name under the "Host Name" item (any name, representation of the Unix host name), in "Host / Ip "Enter the IP address" 129.6.5.2 "," Telnet Port "," Telnet Port "," Telnet Port "," CONNECTION ", click" Add "button, then click" OK "button.

Netterm's operation: Start Netterm first, click on the phone icon, there will be a workfall, prompt to enter the UNIX username:

Digital UNIX (XYW) (TTYP6)

Login:

The future operation is like operating on the UNIX host terminal.

Second, FTP

FTP is Telnet's "close relative". Telnet allows you to log in and use your resources on a remote host, and FTP allows files to be delivered between local computers and remote hosts. FTP is the abbreviation of File Transfer Protocal, which is a file transfer protocol that copies one or more files on the remote Unix system to the local computer, or copy one or more files on the local computer to the remote UNIX system .

(3) Basic file type

When we use ftp, you can simply divide the files into two categories: text files and binary files. Text files are also known as ASCII files, and its file content follows ASCII definitions, and the main features are as follows: ASCII files consists of several lines; can display and edit commands with the operating system to display and edit the ASCII file content. Binary files are all file formats other than ASCII files. It is a pity that the ASCII file format of different operating systems is generally incompatible, and FTP automatically performs format conversion when the transmission of ASCII files between different operating systems, and for binary files, FTP does not conversion . [Precautions] You can transfer the ASCII file to binary mode, but will never transfer binary files to ASCII mode, otherwise the contents of binary files will be destroyed and cannot be used.

(2) FTP use

The general operational format of FTP is as follows:

FTP IP address or domain name

The above IP address or domain name refers to the IP address and domain name of the remote UNIX host. Information will appear on the local computer screen, prompting the user to enter UNIX username and password, and finally the FTP prompt appears:

FTP>

You can enter the ftp command in this prompt.

[Precautions] The TCP / IP protocol between the local computer and the remote host must be guaranteed before running the FTP.

(3) FTP common command

The common commands and explanations of FTP are as follows:

FTP command explanation

? Or Help [command] command help

Binary settings in binary

ASCII settings to transfer files in ASCII mode (default)

CD [Directory] Change the remote directory

PWD lists the current remote host directory

DIR [R-DIR] [L-file] Displays the remote directory content, R-DIR represents the remote directory, and the L-file represents a local file. If there is a local file, write the result to the local file.

LS [R-DIR] [L-file] is different from DIR, just display format

LCD [Directory] Change the local directory

Put file1 [file2] copy local file1 file to remote file2

Get file1 [fine2] copy remote file1 file to local file2

MPUT FILES copys local multiple files Files to remote

MGET Files copys remote multiple files to local

Status Displays the current FTP status

! Command performs a local command and returns FTP immediately

Open IP address or domain name re-established new connection

Close Close Remote Connection

Quit or Bye exits FTP

(4) FTP instance

Suppose the IP address of the remote host is 129.6.114.201, the operating system is SCO UNIX, the local computer is a PC, the operating system is DOS, and the FTP client program is placed in the C: / FTP directory.

[Example 1] FTP operation

C:

CD / FTP

FTP 129.6.114.201

(Enter the Unix username and password, the prompt will appear :)

FTP>

[Example 2] Copy the Help.hlp under the local computer C: / DOS directory to the / usr / xyw / TMP directory of the remote host. The command is as follows:

FTP> binary

FTP> LCD C: / DOS

FTP> CD / USR / XYW / TMP

FTP> Put help.hlp

[Example 3] All files under the local computer C: / TEMP / TO directory are copied to the / usr / xyw / TMP directory of the remote host. The command is as follows:

FTP> binary

FTP> LCD C: / TEMP / TO

FTP> CD / USR / XYW / TMP

FTP> MPUT *. * [Example 4] Copy the / usr / xyw / bin / dispdate text file of the remote host to the local computer C: / TEMP / FROM directory. The command is as follows:

FTP> ASCII

FTP> LCD C: / TEMP / FROM

FTP> CD / USR / XYW / BIN

FTP> Get Dispmesg

[Example 5] Copy all files in the / usr / xyw / doc directory of the remote host to the local computer C: / TEMP / FROM directory. The command is as follows:

FTP> ASCII

FTP> LCD C: / TEMP / FROM

FTP> CD / USR / XYW / DOC

FTP> MGET *

[Example 6] FTP exit

FTP> Close

FTP> quit

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

New Post(0)