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

The Foundation of linux Command (1)

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Linux Command Foundation

Shell

I. definition of shell:

In computer science, Shell, commonly known as shell (used to distinguish it from kernel), refers to software (command parser) that "provides the user with an interface". It is similar to command.com under DOS and later cmd.exe. It receives user commands and then invokes the appropriate application.

A special program running in 1.LINUX system

two。 Act as a "translator" between the user and the kernel

3. When a user logs in to the LINUX system, a SHELL program is automatically loaded

4.BASE is the default SHELL program used in LINUX systems

Accept the instructions entered by the user "" explain the command "" and pass it to the system kernel to run

II. Classification of shells

III. Format of shell command line

The common command line uses the format:

1. Command word

two。 Option

3. Parameters.

four。 Auxiliary operations for editing the command line

five。 The way to get command help

First of all, let's understand the meaning of [root@localhost ~] # in the Shell interface.

Root: current system login user

Localhost: host name

~: current directory (now home directory)

#: administrator identity ($: ordinary user identity)

Command

1, pwd

View the current working directory

2.cd

Switch working directory

1.cd target location: switch to target location

2.cd ~: switch to home directory

3.cd.. Return to the previous directory

4.cd -: returns the directory where the last cd was executed

The form of expression of relative path:

1. With a. Beginning: indicates that the current directory is the starting point

two。 With two... Beginning: indicates that the directory above the current directory (the parent directory) is the starting point

3. Start with ~ user name: start with the specified user's host directory

2.ls

Displays the contents of the directory, including subdirectories and file-related attribute information

Common option

1. Murl: displays the file size (no units, default is bytes)

2. Mura: display shadow files (without distinction between Chinese and English punctuation)

3.Mura: show hidden files (distinguish between Chinese and English punctuation)

4. Murd: this catalogue

5.Murh: friendly display (file size display unit)

6. Murr: recursive display (shows all files in this directory, including subdirectories and files in subdirectories)

7.--color: display color

The system displays colors by default

Black: data fil

Green: executable file

Red: compressed package

Blue: directories (folders)

Sky blue: soft connection files (shortcuts)

Pink: picture

3.-alias

Set aliases: simplify commonly used, longer commands

4.-du

Statistics on the occupancy of catalogues and space files

Common option

-a: include all files when counting disk footprint, not just directories

-h: displays statistical results in a more humane way (KB counts by default, but no units are displayed)

-s: only the total space is counted.

5.-mkdir

Create a new directory

-p: create nested multi-tier directories at once

6.-touch

Create an empty file

7.-ln

Create a connection file

Ln-s create a soft connection

8.-cp

Copy a file or directory

Optional

-f: force copy directly without reminding when overwriting a directory or file with the same name

-I: a reminder when overwriting a directory or file with the same name

-p: keep the permissions, ownership, time stamp and other attributes of the source file unchanged when copying

-r: recursive replication

9.-rm

Delete a file or directory

Optional

-f: delete without reminder, force deletion

-I: remind you when you delete

-r: recursive deletion

10.-mv

Move a file or directory

(if the destination location is the same as the source location, it is equivalent to a rename operation)

11.-which

Find the command / file storage directory

Or

20.-find

Find a file or directory

Use recursive method to accurately search according to different attributes such as name, type and size of the target.

Common types of lookup

Use logical operators between expressions

-a means and

-o indicates or

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