TTY Console terminal tty1~tty6?
CTRL + ALT + F2~F6 switch console
ALT + F1 return
However, after using init 3 in the graphical interface, you cannot use ALT + F1 to return, because the two are not a problem.
Init 3 Toggle Current Run level
CTRL + ALT + F2~F6 Toggle Current Workspace
PTS Virtual Terminal
If we telnet to the host remotely, do we need a terminal interaction?
Yes, this is the virtual Terminal Pty (pseudo-tty)
PTS/PTMX (PTS/PTMX combined to achieve pty)
Use who am I to query the PTS number of the current terminal
Magnification: ctrl+shift+ +
Zoom Out: Ctrl +-
1.1 Linux Terminal introduces shell prompt Bash Shell basic syntax.
[Email protected] ~]#
Where Root refers to the current user
Xiaogan refers to the host name
~ refers to the current directory
#代表当前权限为root
If it's a normal user, it should be.
[Email protected] root]$
$ represents the current user right for normal permissions
We cannot direct the computer to do anything, because it does not understand, this time need a translator, that is, the interpreter shell
We negotiate with the shell, and the outcome of the negotiations is the instructions we use, ls,cd,pwd.
The shell translates the instructions we send into a language that the kernel can understand, and then implements the instructions.
We interact with the Linux kernel through the shell!
The format used for commands in Linux systems is:
command [options] [parameters]
such as: Ls-a/Home
Indicates that all files are listed in the/home directory
LS stands for command list ' list '
-A description command ls, listing all files
/Home Description Command LS Action object is parameter
1.2 use of BASIC commands: LS, pwd, CD
ls command:
function: See what files are in the current directory
Syntax: LS directory, if you do not add a directory to view the current directory
Parameters:
-L display the shortcut in the detailed information system #ll=ls-l
-A Show hidden files
-D View directory (without viewing the contents)
Why do some catalog files have different colors?
Different colors in the Linux system represent different file types
Blue Directory/etc
Black file/etc/passwd
Light blue link/etc/grub2.cfg
Red Compress Package boot.tar.gz
Green executable file/etc/init.d/network
Black bottom Yellow word device file/dev/sda
PWD command: View current path or current location
CD command: Switch the directory to change the current location
. Represents the current directory
.. Represents the upper level directory
1.3 viewing system and BIOS hardware time
To view the BIOS hardware time:
Hwclock
View system time
Date
"Use date-s Time"
can modify the time
For example: Date-s 2016-12-12
1.4 Linux How to get help, Linux shutdown command: shutdown, init, etc.
Date--help
Fdisk–h
Mans find
The above three commands can be used to view the relative command's Help information
Command--help
Command-H
Man command
Powerful man!!!
Shutdown, init, reboot Poweroff
Shutdown
Function: Shutdown, restart, timer shutdown
Syntax: Shutdown [options]
-R = Restart the computer
-H = power off
-H + time = Timer off
Shutdown-h +10
Shutdown after 10 minutes
Shutdown-h 23:30
Specify a specific point in time to shut down
Shutdown-h now
Turn off the machine now
Shutdown-r now restart
Shutdown-r +10 #10 minutes after restart
Shutdown-r 22:22 # 22:22 Restart
1.5 Linux 7 Boot levels
init command
Role: Switching the system operating level
Syntax: Init 0-6
Linux 7 Boot levels:
0 System shutdown mode, the system default operation level cannot be set to 0, otherwise it will not start normally, the machine shuts down.
1 single-user mode, root privilege, for system maintenance, prohibit remote login, like Safe mode login under Windows.
2 Multi-user mode, no NFS network support.
3 full multi-user text mode with NFS, login to console command line mode.
4 The system is unused, reserved for general use, and in some special cases it can be used to do something. For example, you can switch to this mode to do some setup when your laptop's battery is running out.
5 graphical mode, after landing into the graphical GUI mode, X window System.
6 Restart mode, the default run level cannot be set to 6, otherwise it will not start normally. Running the init 6 machine will restart.
RHEL7 no longer uses the/etc/inittab file for the default boot level configuration
The SYSTEMD uses a more free target substitution than the sysvinit run level.
The 3rd run level is replaced with Multi-user.target.
The 5th run level is replaced with Graphical.target.
Runlevel3.target and Runlevel5.target respectively are
Symbolic links to Multi-user.target and graphical.target.
Switch to the 3rd run level
Systemctl Isolate Multi-user.target
Or
Systemctl Isolate Runlevel3.target
Switch to the 5th run level
Systemctl Isolate Graphical.target
Or
Systemctl Isolate Runlevel5.target
Set the default run-level
Set the default third boot level
Systemctl Set-default Multi-user.target
Set the default fifth boot level
Systemctl Set-default Graphical.target
View the current default startup level
Systemctl Get-default
Fifth day Linux basic commands