Basic concepts, installation and operation of Linux entry

Basic concepts of Linux

1: kernel
To put it simply, the
Linux kernel module of the program that operates the computer hardware has the following: storage management, CPU and process management, file system, device management and driver, network communication, and system initialization and booting, system calls, etc.

2: Release
The release version is to make a package of the kernel and application software
Insert picture description here
3: Disk partition
Disk partition is to divide a disk space into several areas, and then you can specify the role of each area. It
should be noted that there is a swap partition in Linux, and its main function is to use it when the physical space is full. swap swap partition

4: File system
In each partition of the Linux system, files are stored and organized according to a certain method. This method is called a file system. When
we use a file system to save data, we don’t need to care about the actual data saved on the disk. What is the address of the data block, you only need to remember the directory and file name that this file belongs to. The following is the role of each file in the Linux system, that is, the directory structure:
Insert picture description here

Linux installation

Let’s take a virtual machine to install CentOS7 as an example to install the Linux system:
CentOS7 mirror address: Click to download , or you can use the following link to download from Tencent Weiyun: Link: https://share.weiyun.com/BUZ6ETlK Password: 546ws6

Install CentOS7 in a virtual machine

1:
First choose to create a new virtual machine
Insert picture description here
2:
Then select custom
Insert picture description here
3:
Keep clicking Next, to the following figure, choose to install the operating system later
Insert picture description here
4:
The following is to name the virtual machine and choose where to install the virtual machine
Insert picture description here
5:
Set the number of processors and cores
Insert picture description here
6:
Keep clicking Next, the settings inside can be selected by default, and you can set
them again in the future. Then right-click the virtual machine and select the ISO image file we downloaded in the virtual machine settings.
Insert picture description here
7:
Then you will enter the installation interface of CentOS, just wait
Insert picture description here
8:
Select language, select simplified Chinese here
Insert picture description here
9:
The following are some settings of the virtual machine, here can be the default, and then click to start the installation
Insert picture description here
10:
Set a password for the root user, and then wait for the installation to complete
Insert picture description here
11:
After the installation is complete, click Restart
Insert picture description here
12:
Enter the user name and the password you just set to enter the system
Insert picture description here

CentOS setup network

1:
First click edit in the virtual machine to enter the virtual network editor
Insert picture description here
2:
Then select NAT mode
Insert picture description here
3:
Click NAT settings, remember the gateway IP here
Insert picture description here
4:
Use the dhclient command and ip addr to obtain the IP address
Insert picture description here
5:
Insert picture description here
Use vi /etc/sysconfig/network-scripts/ifcfg-ens33 to modify the IP address, ens33 is obtained from the IP address obtained above, and can be modified according to the actual situation.
Insert picture description here
Then click the i on the keyboard to enter the file editable state
and then change BOOTPROTO=dhcp to BOOTPROTO =static, change ONBOOT=no to ONBOOT=yes
and add the following content at the end of the file
IPADDR=192.168.15.128
NETMASK=255.255.255.0
GATEWAY=192.168.15.2
DNS1=192.168.15.0 After
editing, press ESC to exit, and then enter: Save wq and exit editing.
Finally, use systemctl restart network.service to restart the network, and then use the dhclient -r command, and again use the dhclient and ip addr commands to obtain the IP address. You can see that the IP has become the one you just set

Linux basic operating commands

File directory operation command

man:The help command in Linux. Through this command, you can view Linux command help, configuration file help, and programming help.
The following information will appear when you directly enter man. When you use man, you need to follow specific instructions, and then You can see the help information for specific instructions
Insert picture description here
ls : View the contents of the current working directory
Insert picture description here
ll: Equivalent to ls -l
Insert picture description here
cd: Switch current working directory
Insert picture description here
pwd: View the path of the current working directory
Insert picture description here
cp:Used to copy directories or files to the specified location
. The first one is the current file, and the latter one is the copied file
Insert picture description here
rm:Deleting files or directories
Insert picture description here
When deleting a folder, the following problems will occur, you can use the rm -d -r -f command to delete
Insert picture description here
mv:To move a file or directory, and to rename it, use this command to
move out.log
Insert picture description here
to rename out.log
Insert picture description here
mkdir: Create a directory
Insert picture description here

Process operation command

ps: Show running processes
Insert picture description here
kill: end process
Insert picture description here
free: Show memory usage
Insert picture description here
top:Real-time display of system resource usage. Task manager similar to window system
Insert picture description here
sudo: Run the program as an administrator
Insert picture description here
its: Switch to admin user
Insert picture description here
exit: Log out user login
poweroff: Shut down
reboot: Reboot

Text operation command

we: Edit text file
Insert picture description here
cat: Print out the contents of the file
Insert picture description here
more: View the content of the file in pages (only page backward)
less: View the contents of the file in pages (pages can be turned back and forth)
tail: Output the content of the file from the specified point (use the -f option of the tail command to easily view the log file that is changing)
grep: Find a string, usually used in conjunction with other commands

Linux permission operation

User and group operation commands

useradd: Add a new user
Insert picture description here
usermod: Modify user information
Insert picture description here
userdel: delete users
Insert picture description here
groupadd: Add a new user group
Insert picture description here
groupmod: Modify the attributes of a user group
groupdel Delete an existing user group

Permission operation

chmod: Modify file or directory permissions
chown: Modify the owner of a file or directory
chgrp:Modify the group belonging to a file or directory
Insert picture description here
.
Look at the picture above: drwxr-xr-x and -rw-r–r--The
first position (d) represents a file or a directory, and the next three (rwx) refer to The permissions that the current user has, the next three (rx) are the permissions of the current user group, and the last three (rx) are the permissions of other user groups

Concluding remarks

There are many basic commands for Linux, and the commonly used ones are basically those above. If you want to learn more, you can check the rookie tutorial: Linux Commands

Guess you like

Origin blog.csdn.net/qq_34365173/article/details/106481361