Learning with a master LINUX notes -3

Section: Linux Bash Shell Shell Prompts basic syntax
1) terminal description
terminal into a graphical terminal and terminal two kinds of character
graphic terminal: GNOME KDE
character terminal: bash, etc.
2) understanding SHELL
Shell Chinese meaning shell, is as a command interpreter to use. After the user inputs a command to SHELL,
by SHELL translation to the core, so that the kernel in response to a user's operation.
3) internal order and external command
internal command: is when you start to be loaded directly into memory, high-efficiency
external command: load into memory when needed
with a view to type command is an internal command or external command
4) by cat / etc / shells can view all shell type
5) through grep root etc / passwd to see / get the last character in what root shell
6) shell prompt "#" sign and "$" sign of the difference between
# indicates that the current user login is root is the administrator user
$ indicates that the current ordinary users login
using 3.2 basic commands: ls, pwd, cd, history
command [options] parameters
1) ls view the current directory information
important parameters:
the form -l to view a list of
examples: # -l LS / etc
Total 1132
-rw-R & lt -. r-- the root 44 is the root. 1 Jan 15 20:13 the adjtime
-rw-r--r--. 1 root root 1518 Jun 7 2013 aliases
-rw-r--r--. 1 root root 12288 May 19 2018 aliases.db

File types are as follows:
D: directory file
l: Link file
b: block device file
c: character device file
p: Pipe File
- File :: Common

-a display all the files in the directory includes a file to the beginning of the hide.
-S size of the file to be sorted
-r reverse order
2) alias usage of
a: a temporary increase in an alias: alias cdnet = "cd / etc / sysconfig / network- scripts "
B: commencement of the current root user: vim /root/.basharc ->
increasing line at the seventh row: alias cdnet =" cd / etc / sysconfig / network-scripts "->
performing source / root /. basharc it would take
c: take effect for all users: vim / etc / bashrc ->
add the following to the last line: alias cdnet = "cd / etc / sysconfig / network-scripts" ->
execute source / etc / basharc it would take
. 3) usage cd
cd to the user's home directory
cd ~ handover to the home directory
cd .. handover to the parent directory
pwd display the current directory position
4) history displays the history command
history -c command history emptied
through the vertical key Finding history
to look through the history of r + Ctrl
! digital command execution history Article N command
5) shortcut keys
ctrl + c interrupt the execution of
ctrl + l - clear screen
ctrl + d finished entering or exiting
the tab completion command or parameter
3.3 and view the system BIOS hardware time
hwclock time to view the current hardware
-w system time synchronized to the BIOS hardware
-s time synchronization to the hardware in the system BIOS
date to check the current time
date -s "2020-01-20 15:16" current system time set
date "+% F" formatted output current system time
[crond + ntpdate generally used to synchronize the timing of the system time]
3.4 how to help the Linux
mandb to help update an index of documents
man -k firewalld to find the relevant help based on keywords
such as: man -k firewalld.richlanguage to find help rich firewall rules
and then use / example help to find relevant examples of
command --help can also find related help
3.5 and 7 switch command start level
1) switch command
shutdown
used as
shutdown -r now to reboot the server
shutdown -h now off the server
shutdown -r +10 10 minutes after the restart server
shutdown -r 10:10 10 10 point of 5 reboot the server
init
used as
init 0 Close server
init 6 reboot the server
2) 7 levels start
to see the current run level
runlevel or systemctl get-default second command is more common

centos7 no longer use the / etc / inittab file to start the default level configuration, use the more liberal than running sysvinit level of the target instead.
Run replaced with the third stage multi-user.target.
The first stage was replaced with 5 Run graphical.target.
Set to run level
systemctl set-default multi-user.target set the default run level is a multi-user command line mode
systemctl set-default graphical.target set the default run level is a graphical multi-user mode

Role: switching system run level
syntax: the init 0-6
Linux 7 a Start level:
0 System shutdown mode, the system default run level can not be set to 0 or does not start, turn off the machine
1 single-user mode, root privileges for system maintenance, remote access is prohibited, as safe mode Windows logon
more than two-user mode, no network support NFS and
3 full multi-user text mode with NFS and network, after landing into the console command line mode
4 system is not in use , generally do not have reservations, in some special cases you can use it to do something. For example, when the laptop battery dies, you can switch to this mode do some settings
5 graphics mode, after landing into the graphical GUI mode, X Window system
6 restart mode, the default operating level can not be set to 6, or can not start properly . Run the machine will reboot init 6

Guess you like

Origin blog.51cto.com/450955/2470980