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

Basic introduction of Linux and some simple instructions

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

Share

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

1. What is Linux?

It's an operating system.

The most commonly used "desktop" operating system Windows

The most commonly used server-side operating system, Linux

The most commonly used mobile operating system, IOS,Android (essentially Linux)

More essentially, Linux is an operating system kernel

Operating system = kernel + a set of supporting applications

Now the Linux system we use is Centos6.

Based on the Linux kernel, it can be packaged into many different systems, called "Linux distributions".

A common release: Ubuntu,RedHat,Deepin,Debian

The enterprise-level Linux commonly used in companies is RedHat (Red Hat).

RedHat is a fee system and Centos is a free version.

The source code of Centos itself is almost the same as RedHat.

two。 Why learn Linux?

The most important operating system used in the field of Linux servers (none)

The most important operating system used in the embedded field of Linux (one)

Android, the most important operating system used in Linux mobile field (without one)

No matter what kind of development position you are engaged in in the future, Linux is a necessary skill.

Can Linux be used in the desktop world? 1%

3. To what extent should Linux, a classmate in the direction of Java, learn?

For students in C++ direction, learning Linux requires not only basic operations, but also Linux system programming content (API).

For students in the direction of Java, learning Java focuses on learning basic operations, system programming is not needed, and Java is cross-platform.

How to get the Linux environment

The worst policy: install Linux directly on the physical machine (BUG is very inconvenient to use, so it is suitable for "boss" players who like to mess around.)

Best strategy: use virtual machine software (VMWare fee, Virtual Box free) virtual machine software can use software to virtualize a set of hardware devices (virtual computers). Virtual machine software will conflict with 360 and other rogue software.

Best policy: use CVM

Tencent Cloud, Aliyun (real server)

1) there is very little BUG, so you can consult customer service whenever you have any problems.

2) if the program is deployed to the CVM, it can be accessed directly on the public network, and the program can be deployed and demonstrated to the interviewer on the spot.

Use Ctrl+fn+insert copy and Ctrl+fn+insert paste in XShell

4.Linux basic instruction

Benefits:

1. Using instructions to operate the server, the bandwidth requirement of network transmission is very small.

two。 It is more convenient to use scripts to accomplish some repetitive operations.

Directive:

1.ls: view all files and directories in the current directory

Ls-l (ll is abbreviated): view file / directory information / Linux root directory in more detail

The directory structure on the operating system is a tree structure.

Results of ls-l:

D indicates that it is currently a directory

L indicates that it is currently a linked file (shortcut)

-represents a normal file

2.cd: switch the current directory (after using the cd directory, you can enter any directory you want to enter)

[root@VM_0_5_centos /]: the / in square brackets indicates that the current directory is the root directory

~ indicates that the current directory is the user's home directory

Cd.. Switch to the parent directory of the current directory (.. Represents the parent directory of the current directory and the parent node of the current node)

. Represents the current directory (can be omitted)

3.pwd: view the full path of the current directory (absolute path)

If you are a root user, the home directory is in the / root directory

/ root/project/java.oj absolute path

.. / java.oj relative path

4.touch creates an empty file

5.cat reads file contents

6.echo command to write a file

Echo "Big Brother eats Game" > test.txt

Means "redirect"

Redirect: equivalent to call divert

Echo is output to the monitor by default and redirected to the specified file by >

7.rm deletes a file

The delete operation may be prompted, if so, press y to confirm the deletion

Delete operation is very dangerous. There is no Recycle Bin on Linux. Once rm is clicked, it is really deleted and cannot be recovered by conventional means.

In general, the system only marks the file as "unavailable" when deleting the file, and the data may still be left.

How can we delete the file thoroughly and never get it back? (physically delete, smash the hard drive)

Special "hard disk shredder"

8.mkdir create directory

Linux has a philosophy, no news.

Is good news, no news is good news.

Mkdir 111max 222Universe 333-p creates a multi-level directory

9.rm-r delete directory

Deleting a directory needs to be deleted recursively

This deletion process is similar to the "post-order traversal" of the tree.

The directory may contain other files, and when deleting the directory, you also need to delete the internal files.

The directory may also contain other directories, so you have to recursively delete the subdirectories in it.

Rm-rf does not need confirmation and is directly deleted recursively (a very dangerous operation, once the content can not be recovered by conventional means)

Rm-rf / operation of NO 1 in all dangers, hit this command = = to die

10.man looks at the help information for a command

Centos can set system language (simplified Chinese / English)

The man manual is consistent with the system language (it is recommended to see the English version)

Supplementary note: the skill of typing instructions

1.Tab key: automatic completion command

Knock once to try to complete the content, quickly knock twice, can prompt all possible options

two。 Clean the screen using Ctrl+l

3. Use Ctrl+c to cancel the currently half-typed command

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