Linux core Cheats
- Linux systems are strictly case-sensitive
- Linux everything File
- Space required between Linux commands
1. The computer is made up of hardware and software
Hardware: Visible, Touch (monitor/keyboard/mouse/Chassis/motherboard/cpu/memory/HDD ... )
Software:
System software Windows/linux/unix
Application software qq/360/office/...
2. Computer classification
Almost 99% of PC installed is Windows, currently preferred Windows 10
The server is almost 90% more Linux installed
First, the installation of Linux system
- Linux directory structure
/root partition Linux file system starting point
Linux system has and only one root partition, all the data inside Linux is stored in/below
/bin commands used by ordinary users
Commands used by/sbin administrators
/boot store boot-related files, kernel vmlinuz ...
/root Administrator's Home directory
Home directory for normal users
/dev storage device related, hard drive, optical drive, floppy disk, keyboard ...
/etc configuration file storage location
/var store data, log related
/tmp temporary file storage location
2. File system
Concept: Format of the disk
Windows NTFS, Fat32
Linux XFS, EXT2/EXT3/EXT4
Swap swap partition, virtual memory 8G
3. Installation environment for new CENTOS7
Double-click Desktop VMware Workstation Pro icon/File/new virtual machine/custom, next/Select Install OS later, next/select Linux,red Hat Enterprise 7 64 bit, next/Modify virtual machine name CentOS7, Installation location Change D:\Virtual Machines\centos7, next/Next/Memory 2048M, next/next/next/HDD modified to SATA, next/Next/HDD adjusted to 80G, next/Next/Finish
4. Installing CentOS7 in VMware
A. Insert the installation disc
Select CD/DVD (SATA)/select Use ISO image file/d:\ Network package \ Package \iso\centos-7-x86_64-everything-1511.iso/ensure the above device status is selected/determined
B. Start the virtual machine power, select Install CentOS 7, enter
C. Installation language Select Chinese, Simplified Chinese, continue, keyboard/options/ctrl+shift/complete
security/Close/Finish
Software Selection/gnome/complete
D. installation location/I want to configure partition/finish/select Standard partition,
Click +/mount point Select/boot, size 200M, add mount point/
Click +/mount point selection/, size 20000M, add mount point/
Click +/mount point to select Swap, size 8192M
Finish/Start Installation
E. Click the root password, set the password to CentOS, complete/restart
F. Post-installation initialization (if text interface): 1--2--and C--C
Second, the basic operation of Linux system
1. Account Management
Windows Administrator Administrator
Linux Administrator Root
2. Switching between graphical desktop and command-line interface
CENTOS7 provides F1-F6 6 terminal environments, where F1 is a graphic, F2-f6 is a character
Enter the character interface from the graphical desktop Ctrl + Alt + (F2-F6)
Character interface into graphical desktop ALT + F1
Toggle between character interfaces Alt + (F2-F6)
Practice:
1) Press CTRL + ALT + F2 to switch to the second character console
After login: Enter root, press ENTER to confirm
After password: Enter the root user's password, press ENTER to log in
2) Press ALT + F3 to switch to the third character console
After login: Enter root, press ENTER to confirm
After password: Enter the root user's password, press ENTER to log in
3) Enter Exit to exit the third character console
4) Press ALT + F1 to return to the graphical desktop environment
The
3.Linux command uses
pwd to print the current working directory, which is equivalent to the Windows Address bar
CD switch directory
CD. Current directory is unchanged
CD: Returns to the previous level of directory
CD. /.. Return to previous level
CD-Back to previous directory
CD ~ = CD returns the current user's home directory
LS list contents in current directory
-l long format display the contents of the current directory
double-click a directory under Windows = Linux inside CD + LS
4.Linux The effect of the following color
Blue indicates folder
Red compressed file
Green executable
Black normal file
Yellow device file
eg
[[Email protected] ~]# CD//
[[email protected] ~]# pwd//
/root
[[Email protected] ~]# CD. //
[[email protected] ~]# pwd//
/root
[Email protected] ~]# CD. //
[[email protected]/]# pwd//
/
[Email protected]/]# CD. //
[[email protected]/]# pwd//
/
[Email protected]/]# CD/ETC/PKI/CA
[Email protected] ca]# pwd
/etc/pki/ca
[Email protected] ca]# CD. /..
[Email protected] etc]# pwd
/etc
[Email protected] etc]# pwd
/etc
[Email protected] etc]# cd/root/
[Email protected] ~]# pwd
/root
[Email protected] ~]# CD-
/etc
[Email protected] etc]# pwd
/etc
5. Configure the Network
Ifconfig View current Network information (IP address, subnet mask)
Route-n View Gateway
cat/etc/resolv.conf Viewing DNS Addresses
Hostnamectl Viewing host names
Graphics Configuration Network
Alt+f2
Nm-connection-editor
Reactivate the network in the upper right corner
Verify
Hostnamectl-sethostname xxx.xxx.xxx
[Email protected] ~]# Hostnamectl
[Email protected] ~]# Hostnamectl set-hostname teacher.tedu.cn
[Email protected] ~]# Hostnamectl
Static hostname:teacher.tedu.cn
Icon NAME:COMPUTER-VM
Chassis:vm
Machine ID:D3F0970C5308449D950E3453C9A449BA
Boot Id:c5799a77789d47ca9a670064a03655eb
Virtualization:vmware
Operating System:centos Linux 7 (Core)
CPE OS Name:cpe:/o:centos:centos:7
Kernel:linux 3.10.0-327.el7.x86_64
Architecture:x86-64
command to configure the network
NMCLI Device status Lists all network card devices
NMCLI Connection Show lists the configured network connections
Manually set the IP address/mask to allow automatic connection
NMCLI con mod "connection name" Ipv4.method manual ipv4.address "IP address/Mask bit"
NMCLI Connection Modify eth0 ipv4.method manual ipv4.addresses "10.0.0.10/255.255.255.0"
NMCLI con mod "connection name" Connection.autoconnect Yes
NMCLI Connection Modify Eth0 connection.autoconnect Yes
Manually specify a default gateway, DNS address
NMCLI con mod "connection name" Ipv4.gateway Default gateway Address
NMCLI con mod "Connection name" Ipv4.dns DNS Address
NMCLI Connection Modify Eth0 ipv4.gateway 10.0.0.254
NMCLI Connection Modify Eth0 Ipv4.dns 4.4.4.4
Deactivate the specified connection
Nmcli con Down "Connection name"
Activates the specified connection
Nmcli con Up "Connection name"
NMCLI Connection down Eth0
NMCLI Connection up Eth0
Ifconfig
Eno16777736:flags=4163<up,broadcast,running,multicast> MTU 1500
inet 10.0.0.10 netmask 255.255.255.0 broadcast 10.0.0.255
Route-n
Kernel IP Routing Table
Destination Gateway genmask Flags Metric Ref use Iface
0.0.0.0 10.0.0.254 0.0.0.0 UG 0 0 eno16777736
Cat/etc/resolv.conf
Generated by NetworkManager
Search tedu.cn
NameServer 4.4.4.4
Additional experiments:
- Baidu "to the IoE"
Practice (Command line mode):
1) Press Ctrl + ALT + F2 to switch to the second character console
After login: Enter root, press ENTER to confirm
After password: Enter the root user's password, press ENTER to log in
See which directory is currently under
Pwd
/root
Switch to the/boot directory to see where the directory is currently located
Cd/boot
Pwd
/boot
See which documents are in the current directory
Ls
Return to the/root directory
Cd/root "or CD"
See which documents are in the current directory,/boot,/directory, respectively
Ls
Ls/boot
LS/
"# Ls/root/boot/"
Getting Started with Linux notes 1