Marco the first week of education

Weekly study summary
### Chapter Linux Basics
main chapters:
#### Terminal
to view the current terminal command: tty
implementation of the results:
[root @ centos7 the Data] # TTY
/ dev / PTS / 0

#### shell
What is shell: Shell is a Linux system's user interface, provides users with the kernel, an interface interaction. It receives a command input by a user and put it into the kernel execution.
Simply the shell is the channel between the user and the kernel, compile command entered by the user is transmitted to the core, let the kernel to call the hardware.
also known as the Linux shell command interpreter
shell is an advanced programming language
a Linux system, there are various types of shell, bash is the default shell centos
display currently used for the shell command: echo $ SHELL
displays the current system used All shell: CAT / etc / shells
[root @ centos7 testdir] # CAT / etc / shells
/ bin / SH
/ bin / bash
/ usr / bin / SH
/ usr / bin / bash
/ bin / tcsh
/ bin / csh

#### command prompt
[root @ centos7 testdir] # # $ superuser for the average user
to display the current format of the command prompt: echo $ PS1
[root @ centos7 testdir] # echo $ PS1
[\ U @ \ H \ W ] \ $
prompt related meanings:
\ E control symbol \ 033 \ u of the current user
\ h hostname abbreviated \ H host name
\ w the current working directory \ W-yl current working directory name
\ t 24 hour time format \ T 12 hours format
after! boot command history command history number number #

#### shell command into two categories; internal commands and external commands
inner shell is made by a built-in, but the command is provided by some form of
external command is an executable program file corresponding to the file system path.
Hash cache table
must first know the path to an external system of command which has to centos7 example:
running echo $ PATH command
[root @ centos7 testdir] # echo $ PATH
/ usr / local / sbin: / usr / local / bin: / usr / sbin: / usr / bin: / root / bin
All of these paths to an external system commands (with different paths: spaced apart). In other words, the system is running an external command is in the path of these searches, and later found to execute the command path recorded in the hash table, the next will be the first match in the hash table, if the table does not go to the PATH Search
hash hash displays cache
hash -t name name command to display the cache path
hash -d name name command to delete the cache
hash -r to clear all cache

Display all alias command current shell alias
[@ centos7 the testdir the root] # alias
alias = CP 'CP -i'
alias egrep = 'egrep --color = Auto'
alias fgrep = 'fgrep --color = Auto'
alias grep = '= Auto --color grep'
Alias L. = '-d LS. --color * = Auto'
Alias LL = 'LS = Auto --color -l'
Alias = LS 'LS = Auto --color'
Alias Music Videos = 'Music Videos -i'
alias RM = 'RM -i'
alias Which = 'alias | / usr / bin / --read Which --tty-only-alias --show-DOT --show-tilde are'
define an alias: alias name = 'ls' defined as an alias for the current terminal is only effective, if you want to have to be arranged in the permanent / etc / bashrc file, and make it effective source / path / to / config_file
withdrawn alias: unalias

#### date and time
Linux two clocks: the system clock and hardware clock
date display system
date +% F 2019-07-25 displayed this time
clock display hardware clock
-s clock of the hardware, the correction system clock
-w subject to the system clock, the hardware clock correction
time zone: / etc / localtime
modifying zone
in the centos7, timedatectl list-timezones lists all time zones
timedatectl set-timezone Asia / Shanghai Shanghai modify the time zone CST

#### simple command
to create a new screen session: screen -S [SESSION]
join screen session: screen -x [SESSION]
echo command
echo "$ VAR_NAME" variable will be replaced by a weak reference
echo '$ VAR_NAME' variable is not replaced, strong references

The extension command line:: $ () or `` e.g.
echo "This apos System IS $ name (hostname)"
This name IS server1.example.com with System apos

echo "I AM whoami"
I AM the root
plus extension brackets: {}

history show history command execution

whatis displays a brief description of the command

Guess you like

Origin blog.51cto.com/14473148/2424376