[Linux Advanced Road] Initial Linux

1. Background of the times

  • Historical Background: The Cold War between the United States and the Soviet Union
  • Promote: technological innovation and technological breakthroughs
  • For example: On February 14, 1946, the world's first general-purpose computer and the world's second electronic computer was produced - ENIAC.
  • Purpose: ballistic calculation

Baidu:
ENIAC
ABC - the world's first electronic computer
Extension:
Moore's Law - This provided the possibility for computer miniaturization at the time.

2. Silicon Valley development model

  • A sustainable model for developing science and technology

  • Leadership: Government + Military - Provide financial support
  • Technical personnel: talents from research institutions + universities
  • Role: Promote the birth of new technologies

  • Business Leaders: Businessmen—Bill Gates and Steve Jobs
  • Financial Source: Financial Trading Place – Wall Street
  • Technology source: research results of scientific research institutions
  • Initial incubated commercial products: civilian computers + operating systems
  • Profit model: Open up markets around the world and achieve global profits

  • How the government makes money: mainly through taxation
  • Circular approach: reinvest tax dollars into technology research and development

  • The development direction of computers: software + hardware
  • Representative company of software: Microsoft (the initial focus was on software, but due to competition from Apple, it teamed up with Intel to develop hardware)
  • Representative companies of hardware: Apple - engaged in both software and hardware, IBM - for enterprises and research institutions

3. Operating system

basic definition


  • A computer can be divided into: hardware + driver device + operating system + application software
  • operating system:
  • Definition: The operating system is the hardware and software that controls and manages the computer system , and the system software that allocates and schedules resources.
  • Purpose: Reasonably utilize and allocate system hardware resources to better serve application software .
  • Example: A good operating system will make your game playing smoother!

Common operating systems

  • Unix - a closed source operating system
  • Linux - Linux is not Unix (acronym) open source operating system
  • DOS - disk operating system
  • Windows - Microsoft
  • Mac – Apple

  • Linux is an operating system created by Linus when he was a sophomore at the University of Helsinki. Because UNIX systems were expensive at the time, Linus spent nine months creating an operating system. It was not called this name at first, but the file manager When I uploaded it, I felt that the original name was not good, so I changed it to Linux. Later, Linus open sourced it and top hackers and engineers improved it. Currently, Linux has tens of millions of lines of code.
  • Linux official website

Open source is not necessarily free. Open source code becomes a paid version after being re-commercialized (plus services)

  • Features of Linux: stable, secure, fast, and low cost.
  • Commercial version of Linux, the centos personal/student version here is free
    Insert image description here

Common installation methods for Linux systems

  • virtual machine
  • Cloud Server
  • Dual system

  • Recommended: cloud server
  • Reason: Reinstalling the system is very simple
  • Disadvantages: It’s a bit difficult to do it for free—it costs about a hundred dollars a year

  • Cloud server installation process:
    Insert image description here

Insert image description here
Click to buy and select the version to be installed - centos7.6

Insert image description here

  • Then download Xshell
  • Official website: Click to download - information needs to be filled in

Insert image description here
This is the domain name of our cloud server.

4. Use of basic instructions

  • At least one space is required between instructions

Login instructions

  • ssh username+@+domain name

Illustration:
Insert image description here
1. Add a space after ssh here
2. We all used the super user (root) at the beginning, and different users can create
3. Domain name: Here is the domain name of my cloud server


User related instructions

  • addsuer + username

Illustration:
Insert image description here

Then we need to set a password for this user

  • Instructions for setting passwords - ordinary users can also change passwords
  • passwd + username

Illustration:
Insert image description here
Note:
1. The password set here will not be echoed, that is, you cannot see what you entered here. 2. The
password needs to be re-determined.
3. If the setting is successful, it will display:: All certification marks have been successfully updated!

  • Delete user instructions
  • userdel -r + username

Illustration:
Insert image description here
At this point we have successfully deleted this username


  • View current username
  • whoami

Illustration:
Insert image description here
Here we are logged in with the root account. So the root displayed


ls command - information viewing

  • Instructions to view files or folders in the current directory
  • ls

Illustration:
Insert image description here
When you do nothing, directories and folders are empty

  • Commands to display more file information
  • ls -l
  • We first create a directory dir1 here, and the specific operations will be given below.

Illustration:
Insert image description here
We create another test.txt file and execute the ll command.
Insert image description here
The files starting with - here refer to ordinary files.
Return to the root directory and execute ls -l
Insert image description here

ls -l is equivalent to ll

  • Summarize:
  • -The beginning is an ordinary file
  • The ones starting with d refer to directory files
  • The one starting with l is the link file

  • Show hidden files command
  • ls -a

Illustration:
Insert image description here
Existing in any directory of Linux: hidden files

  • Display directory file name
  • ls -d +specify file directory

Illustration:Insert image description here

  • Show file types
  • ls -F

Illustration: Insert image description here
"*" represents an executable ordinary file; "/" represents a directory; "@" represents a symbolic link; "|" represents FIFOs; "=" represents sockets (sockets)

  • Summary: ls -l and ls -d here can be used together - ls -ld, and the rest are the same.

pwd command - prints the current file location

  • pwd(print working director)
  • Ordinary user:/home/xxx
  • root user:/root/xxx

Illustration:
Insert image description here

  • Instructions for creating directories
  • mkdir(make director) + directory name

Illustration:
Insert image description here
At this point we have created the directory


  • Absolute path: refers to the absolute location in the directory, directly reaching the target location (starting from the root directory to the target file),Its uniqueness is because each node has only one parent node
  • Relative path: starting from the current directory to the target file, but when the current directory is deleted, this path becomes invalid
  • Path separator:Linux:/ Widows:\

cd command - access files

  • Enter the specified file
  • cd + file directory

Insert image description here

  • cd +...enter the previous directory

Insert image description here

  • cd + .enter the current directory

Insert image description here

  • cd + ~restore to the directory where you logged in

Insert image description here

  • cd + - Go to the last file you were in

Insert image description here


rm——delete command

  • rm + file name (normal file)

Insert image description here
Confirmation is required when deleting

  • rmdir + directory

Insert image description here

  • rm -r + directory

Insert image description here
Recursively delete directories, but you have to confirm whether to delete them

  • rm -rf+directory-forced deletion

Insert image description here

  • rm -i +file - ask before deleting files
  • When we delete files under ordinary users, they will be deleted directly without adding the -i option. However, under the root user, they will be deleted even without adding the -i option. The reason is that deleting files under root is considered more dangerous by the system.

touch - create files and modify file information

Create a file

  • touch + file name (specific to the format)

Insert image description here
At this point we have created an ordinary text file.
Additional: Another function is to update the last modification time of the file.

Common options

  • -a or –time=atime or –time=access or –time=use only changes the time of access and change.
  • -c or –no-create does not create any documentation.
  • -d ["Time Information"] Use the specified date and time instead of the current time.
  • -f This parameter will be ignored and will not be processed. It is only responsible for solving the compatibility problem of the BSD version of the touch command.
  • -m or –time=mtime or –time=modify only changes the modified time.
  • -r sets the date and time of the specified document or directory to be the same as the date and time of the reference document or directory.
  • -t Use the specified date and time instead of the current time.

tree - graphical file

This instruction requires downloading:

  • Download instructions: yum install -y tree

Here is the quote
After we create several directories and display them graphically, they will look like this.

Guess you like

Origin blog.csdn.net/Shun_Hua/article/details/130150356