File foundation of UNIX Basis and shell

xiaoxiao2021-03-06  43

File foundation of UNIX Basis and shell

UNIX always is a strong job system, standing for many years, but it is true for users who usually use personal computers.

Compare unfamiliar, see, and this editorial department can also operate on a personal computer, there is no huge mainframe or even

What is the big machine's SCO UNIX, introduce it to you, let you see the other in the field of another vast and unlimited work, maybe play

When IterNet, there will be another world, don't miss this "UNIX basic article" in this connection.

Some people may mistakenly think that UNIX is just the working system that the powerful huge machines will use, who doesn't know in one

On the computer, you can use it, but the PC UNIX designed for personal computer is, SCO UNIX is

Among them.

For friends who are used to DOS or window, UNIX's first grade level is those "sensitive labels" (Sensitive

Case), the case of the letter has different meaning, LS, IS, LS or IS these instructions are all different, so-called "poor

Cheric, a thousand miles, it is absolutely sensitive to case sensitive.

file name

Under SCO UNIX, the file file name established can be any combination of up to 14 alphanumeric characters, both

You can use the next horizontal "□" or you can use the number. However, the name of the file cannot be used because some specific characters are used because

They have a specific meaning for the shell. These characters that cannot be used as the file name, namely ";" "|", "<",

">", "'" "$",

"!", "%", "(" And ")", and the file name can not contain blank spaces.

File access rights

Each file can have different access rights, defining other users to access files and directories. Each file is divided into three

Class Ownership: The properties of the file, the members of the main group (ie, group members), other users who can access the system. "LS"

The directive to view the permissions of the file.

DRWXRWX ...

It seems that the file access permissions listed, the first symbol indicates the file type, the reduction is normal file, and D represents the directory file.

. Then nine characters are divided into three groups, indicating the access rights of the owner, group members, and other users; there are three access rights per group.

: "Read, W" and X "Execute). No access to access.

Reason is reduced (-) instead.

Catalog access

Basically, the settings between the documents and the access rights of the directory are roughly the same, but still slightly. First, to view the directory

access

Permissions, after "|", add a blank place, plus "-d". If you want to change the current directory, use "C

d.

Change access rights

To add access rights to the file or directory, you can use the "chmod" instructions, as follows:

$ CHMOD G RW FileName

g represents that change of the group members can enjoy, RW is to let the group members can read and write the file. And U is on behalf of the document

Attributes, O represents other users; minusks (-) represents some of the access rights to some of the person. Another way to change permissions

The method is to specify access rights using an octal value. Each symbol is assigned to a value, R is 4, W is 2 and X are 1. For example, a combination read and write, the value of its access is 6. For example, if you want to make the file owner, the team members and other users are read.

The right, the directive is as follows:

$ Chmod 666 filename

Change user home owner

Whenever a new file is created and a directory, tagging you is the owner, your homework is a member, if you want to pay the file's use

give others,

Only the main party can change, the instructions are as follows:

$ Chown Owner File

Chown changed the file identity ID (UID) change the group to change the group belonging to the file - file group ID (GID),

The command becomes:

$ Chgrp group file

Browse the file content

Need to help, can you press? key. As for the browsing file content, there are several ways to use more, display big files, instructions such as

under:

$ More filename

Press to display the next full screen of the body; press to transfer the next line; press q to enter and enter the file;

When you enter a mode prefix (/), you can type a matching mode that you need to find. If you can't find it, you will display "Pattern NO"

Information of t found. Press PG to turn a screen number again, and after each full screen, you will follow the prompt (:), press

URN>, look at the next screen, type N, move N screen forward; -n, move N screen backward; to enter $, then move to

File end. If you use CAT to see the file content, you can scroll through the file content on the full screen. Press

L> S, the file will stop scrolling; press Q, continue scrolling; press to interrupt.

Handle file

The CP instruction is a replication file, and there can be many usage.

(1) $ cp old.file new.file back up a file

(2) $ CP File 1 File 2 TEST Put File 1 and File 2 to the Test Directory

As for the MV, the MV is the renovation command, for example

$ Mv fruit apples is Fruit to rename Apples

Rm is the instruction to delete the file. If the file is deleted, you can't restore it, so this is docked.

$ RM- I FileName plus "-i", before deleting, the system needs to confirm.

Shell environment

What is the interactive layer between the user and the operating system, the user modifies its environment, setting or canceling the ring of the shell

Avorization, catering to the needs of users and hobbies. Shell itself is a computer program, written in C language, to assist users

Designed between communication between the operation system, manage the dialogue between users and core (DERNEL), and replace the job system instructions.

Machine code, in fact, PC users commonly used DOS, itself is a shell.

Use of shell

The main task of the shell is to prompt the user to enter the instruction, read instruction, and the conversion instruction can be understood by the core. In fact, shell can be seen as an instruction interpreter, providing some tools, can also use shell's writing tools to construct a computer

sequence.

System v shell class

SCO System V's shell can be divided into four categories: bourne shell; c shell; korn shell; and menu drive SH

Ell. The menu driver shell can be divided into three categories, respectively, Open Desktop, sysadmsh, or scoadmin and customers.

application. Each shell has its own specific environmental file, which can be modified by itself, and these environment files are like

DOS's batch file.

Bourne shell

For a common user, Bourne Shell can be said to be the first Unix Shell, which is from AT & T Bell Lab STEPH

EN BOURNE is written. The default prompt (prompt) is the US dollar ($), its environment file is a profile file, due to

The file file is not large, and it can be started immediately. Profile is a normal text file stored in the main directory (Text File

), By setting the environment variable (variable) and terminal mode, the environment can be made, and each registration is entered.

The shell reads the Profile file and performs the listed instructions. Whenever the system administrator creates a new user's account,

The system will automatically construct a corresponding .profile file; the entire system's environment file is placed in /etc/.profil

e. Users can modify using VI or other text. To use the ENV command, this is set up due to registration

Some variables do not necessarily need to be set.

C shell

C shell is written by Berkeley's Bill Joy, which is the standard BSD (Berkeley System Distributou)

Release, its default prompt is the value (%), and the environment file is CSHRC and .login. C shell uses C language, which is UNIX and

The development language of the Xenix system provides easy tools, quick access, calibration, and reproduction of the command line. .lo

GIN is the registered environment file of c shell, responsible for launching the shell, executing once when registering, and .cshrc stores common instructions

Such as Alias ​​and other instructions. For example, we have to create a permanent alias, put the command who | sort | more inereminated to WH,

After the (%), just type the WH

can. Users can type below .cshrc □:

Alias ​​Wh 'Who / Sort / More'

Korn shell

Korn shell is developed by AT & T Bell Lab David Korn, which is a enhanced version of Bourne Shell, informabing BOUR.

The characteristics and conventions of Ne shell and C shell, while the Korn Shell is faster than Bourne and C shell. Korn S

Hell's default prompts and environment files, like their predecessor - bourne shell, with dollar symbols ($) and .pro

File file. Process control

Although in the same time, there are many processes in the system, but at a particular moment, the CPU will only use a process, while CPU

The process is rapidly rotated between the processes in exercise, and the time occupied by each process is called a time slice. SCO System V In order to

Keep, track or schedule each process, a process identification number ID or PID for each process. To determine those processes are being transported

OK, users can use PS to display your process; or add -e option, display all processes; plus -f option, displayed

The process also includes execution of the execution of the launched instruction; -U login displays a registered user's process. In SCO UNIX SYSTE

In M V, if you have the role of the root directive, you can see all processes. When an instruction takes longer

Completed, you can join & Mache after the tail of the instruction line, the instruction is executed in the background, but instructions for interactive work mode

Not applicable.

Menu driver shell

Menu-Driven Shell can be divided into three:

First, Open Desktop

Open Desktop uses the XWindow graphical user interface, the user can use the icon window and menu operation, such as Open

Desktop's operating system is SCO UNIX SYSTEM V / 386.

Second, the system administrator shell: sysadmsh or scoadmin

SysadMSH or SCOADMIN is a character interface, and users can perform a large number of fingers without learning instruction line syntax and options.

make. Most system management tasks are only managed by system management, and the system administrator has a specific root password (Root Passwor

d).

Third, customer application

Some users use SCO System V, System Tubes to access internal mail, word processing or reporting applications.

The staff can install these procedures to present them in registration. Many programs provide a menu option to select with a simple key

Take an option, users are not required to remember the instructions and instruction options, and can also be controlled.

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

New Post(0)