First acquaintance with LINUX system

First acquaintance with LINUX system

What is LINUX system?

Linux, the full name of GNU/Linux, is a free-to-use and freely disseminated UNIX-like operating system. Its kernel was first released on October 5, 1991 by Linus Benedicte Torvalds. It is mainly affected by Inspired by the ideas of Minix and Unix, it is a multi-user, multi-tasking, multi-threaded and multi-CPU operating system based on POSIX and Unix. It can run major Unix tools, applications, and network protocols. It supports 32-bit and 64-bit hardware. Linux inherits Unix’s network-centric design and is a multi-user network operating system with stable performance

LINUX system evolution history

Before 1965, computers were not as common as they are now. It is not something that ordinary people can touch, unless it is a military or academic research institution, and the mainframe at that time can provide at most 30 terminals (30 keyboards, monitors). , Connect to a computer. In order to solve the problem of insufficient quantity
, Bell Labs joined the MIT and General Electric cooperation plan after 1.1965. The plan was to establish a set of multi-user and multi-processor. , Multi-level (multi-level) MULTICS operating system, I want the mainframe to support 300 terminals
. Around 2.1969, the project was slow and short of funds. Bell Labs withdrew from the research
3.1969 Ken Thompson, who withdrew from this project in 969, was in When the laboratory was boring, in order to run the "Space Travel" game on an idle computer, I took advantage of the time of his wife to visit relatives around August, and spent 1 month using the export The prototype of Unix operating system
4.1970, Ken Thompson of Bell Labs, USA, based on the BCPL language, designed a very simple and close to the hardware B language (take the first letter of BCPL), and he wrote the first in B language A UNIX operating system in
5.1971, Dennis M. Ritchie, who also loves Space Travel, joined Thompson’s development project in order to be able to play games earlier, and co-developed UNIX. His main job is to transform the B language, because The cross-platform nature of the B language is poor
. In 6.1972, Dennis M. Ritchie finally designed a new language based on the B language. He took the second letter of BCPL as the name of the language, which is C Language
7.1 At the beginning of 973, the main body of C language was completed, and Thompson and Ritchie couldn’t wait to use it to completely rewrite the now famous Unix operating system.

Three major desktop operating systems

Windows series (Microsoft Corporation) has a
large user group,
macOS (Apple) is
suitable for developers, and
Linux (open source system) has
less application software

Two mainstream mobile operating systems

IOS (Apple)
Android (based on Linux) (Google)

Two mainstream server operating systems

Windows Server (Microsoft Corporation)
paid
Low share
Linux (open source system) is
free, open source, reliable, safe, stable, multi-platform

Linux version

1. Linux kernel version The
kernel (kernel) is the heart of the system. It is the core program for running programs and managing hardware devices such as disks and printers. It provides an abstraction layer between visual devices and applications. The
Linux kernel version is divided into The stable version and the development version, the two versions are interrelated and circulate with each other.
Stable version: It has industrial strength and can be widely used and deployed. Compared with the older ones, the new stable version only fixes some bugs or adds some new drivers.
Development version: Due to various solutions to be tested, it changes quickly.
Kernel source code URL: http//www.kernel.org.
2. Linux distribution
Linux distribution (also known as GNU/Linux distribution) usually contains application software including desktop environment, office suite, media player, database, etc.

Linux commands

[root@localhost ~]#
Among them, root represents the current login as an administrator, and lacalhost is the current host name. # Means administrator login, $ means normal user login.
1. Switch user
su user name# the directory remains unchanged after the switch
su-user name# the directory becomes the user's home directory after the switch

2. View the full name
hostname of the current host

3. Temporarily set the
hostname hostname
4. Permanently set the
hostname hostnamectl set-hostname hostname
or
vi /etc/hostname (you need to restart the system after setting to take effect)
5. Press the i key to delete the old hostname, and then enter New host name (only the first line is valid)
press ESC, then press SHIFT + ":" key combination, enter wq, then press enter to exit

6. View the current system version information
cat /etc/redhat-release
or
cat /etc/*release

7. Check the current kernel version
uname -r
8. Temporarily modify the network card IP
ifconfig ens33 192.168.80.3/24
or
ifconfig ens33 192.168.80.3 netmask 255.255.255.0

9. Permanently modify the network card IP
vi /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet #Set the network card type, "Ethernet" means Ethernet
DEVICE=ens33 #Set the name of the network card
ONBOOT=yes #Set whether the network card is in Linux Activate
BOOTPROTO=static when the operating system is started #Set the configuration method of the network card, "static" means to use a static IP address, "dhcp" means to obtain the address dynamically
IPADDR=192.168.80.3 #Set the IP address of the network card
NETMASK=255.255.255.0 #Set The subnet mask of the network card
GATEWAY=192.168.80.2
#Set the default gateway address of the network card DNS1=192.168.80.2 #Set the IP address of the DNS server
10. Restart the network card
systemctl restart network
#Restart all network cards ifdown ens33; ifup ens33
ifdown ens33 # Close a network card
ifup ens33 #Start a network card

ifconfig ens33 down #temporarily disable a network card
ifconfig ens33 up #reactivate a network card (the IP address will not be updated)

11. Check the network card address
ifconfig
or
ip a

12 Test network connection
ping
traceroute (static tracking)
mtr (dynamic tracking)

13. Restart the system
reboot
init 6
shutdown -r now

14 shutdown
poweroff
shutdown -h now
init 0

15. Add color to the command line prompt characters
PS1="[\e[1;35m][\u@\h \W]\$[\e[0m]"

Expand the general commands of Baidu search
1. date: print or set the date and time of the system
2. stty-a: view or print control characters (Ctrl-C, Ctrl-D, Ctrl-Z, etc.)
3. passwd: use passwd-h view
4. logout, login: login and logout commands of the login shell
5. more, less, head tail: display or partial display of file content
6. lp/lpstat/cancel, lpr/lpq/lprm: print file
7. chmod u+x: change file permissions
8. rm-fr dir: delete non-empty directories
9. cp-R dir: copy directories
10. fg jobid: you can put a background process in the foreground
11. The role of kill: send a signal to a process, eg: kill-9 sends a SIG_KILL signal. You can view the specific signal sent by man kill.
12, the usage of ps, ps-e or ps-o pid, ppid, session, tpgid, comm (where session Displayed sessionid, tpgid displays the foreground process group id, comm displays the command name)

Guess you like

Origin blog.csdn.net/Dark_Tk/article/details/112727276