Linux Learning Note 1.0

Source: Internet
Author: User
Tags echo command

Terminal (terminal)
Physical Terminal Console Console (/dev/console)
Virtual Terminal (/dev/tty[1-6]) tty:teletypewriters, can have N, ctrl+alt+f[1-6]
Graphics Terminal (/DEV/TTY7)
Serial Terminal (/dev/ttys#)
Pseudo Terminal (/dev/pty/#) pty:pseudo-tty,ssh remote connection
View current Terminal equipment: #tty
·
Interactive Interface
Gui:graphic User Interface GUI
Cli:command lines Interface Command line interface
·
SHELL
The shell is the user interface of the Linux system and provides an interface for users to interact with the kernel. It receives the command entered by the user and sends it to the kernel for execution.
The shell is also known as the Linux command interpreter (interpreter)
Shell is a high-level programming language
·
Shell programs: sh, CSH, tcsh, ksh, bash, GPL, zsh
Bash (Bourne-again Shell) is one of the most important tools in the GNU program and is currently the Linux standard Shell, compatible with SH. CentOS is used by default.
There are two types of commands that can be executed in the shell:
1, internal command: From the shell, and by some kind of command form provided.
Use Help to view, use the Enable operation.
2. External command: There is a corresponding executable program file under the file system path.
·
The hash cache table holds external commands that have been executed, improving the efficiency of external command invocation.
·
Alias defines the command alias, and the alias defined on the command line is valid only for the current shell process and is to be defined in the configuration file for permanent validity.
Valid only for the current user: ~/.BASHC
Valid for all users:/ETC/BASHRC
·
command format:
command [Options ...] [Arguments ...]
Options: One or some of the features used to enable or disable commands.
Parameters: The object of the command, such as the file name, user name, and so on.
Attention:
1, multiple options, and multiple parameters and commands are separated by white space characters.
2. Cancel and End command execution: Ctrl+c,ctrl+d.
3. Multiple commands are available; symbols are separated.
4, a command can be divided into multiple lines.
·
Date and Time
There are two types of clocks in Linux:
System clock: Run by the Linux kernel through the CPU's operating frequency.
Hardware clock: Motherboard
Date displays and sets the system time, Hwclock,clock displays the hardware time.
·
echo Command
Function: Displays characters.
Syntax: Echo [-nee][string]
Description: Echo will send the input string to standard output. The output character putting is separated by a blank character, and a newline number is added at the end.
Options:
-E (default) does not support the \ Interpretation feature.
-N does not wrap automatically.
-e enable \ character interpretation function.
Display variables:
The echo "$VAR _name" variable is replaced with a weak reference.
The echo ' $VAR _name ' variable is not replaced by a strong reference.
·
command-line extensions
$ () | ""
Print the output of the command in the symbol to another command as a parameter
·
Bracket Extension
{}
echo file{1,3,5} output: File1 file3 file5
echo {1..10} output: 1 2 3 4 5 6 7 8 9 10
echo {A.. e} output: A b c D E
·
Tab key
Click the tab command to complete
A user-given string has only one command, which is directly complementary.
Otherwise, the tab will give the list again.
Path completion
The user-given string starts with the path, searching for the file name that begins with the specified string. If only, direct completion. Otherwise, tab again to the list.
Double-click Tab:
Command 2Tab all subcommands or file completion
String 2Tab begins with a string command
/2TAB Displays all directories below the root directory, including hidden directories
./2Tab current directory subdirectories, including hidden directories
2Tab current directory subdirectories, excluding hidden directories
~ 2Tab All Users List
$2Tab All variables
@ 2tab/etc/hosts record (CENTOS7 not supported)
= 2Tab equivalent to ls–a (CENTOS7 not supported)
·
Command History
Saves the input command history, which can be used for repeated execution.
When you log in to the shell, the commands that are recorded in the command history file are read ~/.bashhistory
Commands executed after logging into the shell are only recorded in the cache, which is appended to the command History folder when the user exits.
·
Repeat the previous command:
1, the upper direction key, enter.
2 、!!, enter.
3 、!-1, enter.
4, Ctrl+p, enter.
!:0 Executes the previous command (remove parameters)
CTRL + N Displays the next command in the current history, but does not perform
Ctrl+j executing the current command
!n command to execute the history command output corresponding to the ordinal n
!-n executes the last nth command in history
·
Related environment variables:
Histsize: The number of records in the command history.
Histfile: Specifies the history file, which defaults to ~/.bashhistory.
Histfilesize: The Order History file records the history of the number of bars.
histtimeformat= "%F%T" displays the time.
Histignore= "STR1:STR2: ... "Ignore the str1 command, str2 the history of the beginning.

Linux Learning Note 1.0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.