Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Notes on the use of Shell

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Shell has become the first choice of system administrators because of its stability, efficiency and flexibility.

1. Introduction to Shell:

Command line: an interface for users to enter commands that simply accepts input and then passes the command to the command interpreter.

Shell: the command interpreter. In essence, Shell is a program that provides a line-oriented interactive interface between the user and the operating system. The user enters the command on the command line, and the Shell running in the background converts the command into instruction code and sends it to the operating system.

The commonly used Shell are: BASH, TCSH Shell, Z-Shell and so on. BASH Shell is the Shell installed and used by default.

2. How to open the command line terminal?

(1) ctrl+alt+t. (2) ctrl+alt+F1~F7 can open the command line console. Linux has seven consoles by default. By default, the first six consoles are command line consoles, and the seventh is reserved for the X server.

(3) search terminal in dash and open it directly.

(4) Desktop icon.

3. Command line prompt:

In BASH, a dollar prompt sign'$'is used as a prompt to indicate that the user can enter a command. If the command is executed as root, the Shell prompt will be'#'. Before the dollar prompt in BASH, there is usually a piece of information, including the user name, hostname, and current directory. A complete prompt is as follows: Lewis@lewis-laptop:/home$. Br/ > (2) ctrl+alt+F1~F7 can open the command line console. Linux has seven consoles by default. By default, the first six consoles are command line consoles, and the seventh is reserved for the X server.

(3) search terminal in dash and open it directly.

(4) Desktop icon.

3. Command line prompt:

In BASH, a dollar prompt sign'$'is used as a prompt to indicate that the user can enter a command. If the command is executed as root, the Shell prompt will be'#'. Before the dollar prompt in BASH, there is usually a piece of information, including the user name, hostname, and current directory. A complete prompt is as follows: Lewis@lewis-laptop:/home$.

5. Command line completion:

When entering the file name and command, you only need to enter the first few characters, then press the Tab key, and Shell will automatically complete the file name. If you have typed at the beginning of more than one file, you can press the Tab key twice in a row, and Shell will give you a list of all files that begin with a typed character.

6. Wildcard characters:

Used to match a string of any length in the file name

? Is similar to, but matches only one character

[]: used to match all characters that appear in square brackets.

7. Permissions:

There are three kinds of permission owners: file owners (owners), file group users, and others.

For a directory, the execute permission actually controls whether the user can enter the directory, while the read permission determines whether the contents of the directory can be listed, and the write permission controls the creation, deletion, and renaming of files in the directory.

8. Device files:

A device file is used in Linux to identify a specific hardware device.

There are two types of device files in Linux: character device files and block device files.

A character device file refers to a device from which characters can be read into character sequences, such as magnetic tapes and serial lines.

A block device is a device, such as a magnetic tape, that stores data and provides equal access to each part of the content.

Just as character devices are sometimes called sequential access devices, block devices are sometimes referred to as random access devices. As the name implies, data can be obtained from any random location on the hard disk using a block device, while a character device must be obtained from the serial line in the order in which the data is sent.

Having a device file does not necessarily mean that there is a corresponding hardware device, it just shows that Linux has the potential to handle such a device.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report