1. Basic Knowledge Block: Shell
Self-command by Shell program: Built-in command (BUILTIN)
Standalone executable program file, file name: external command
[[email protected]~] #ls ~ User's current directory #: Command prompt (Administrator account root) $: normal user |
Shell Environment
|
Unique program it refers to the operating system, providing access to the kernel services provided by the program! Intermediate media used by the system to interact with computer hardware, which resolves user-supplied commands.
2. Basic tip: Commands
#echo $PATH: Find the command file that corresponds to the command string that the user typed from those paths. Environment variables: PATH
/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/usr/bin:/root/bin
Check the order must be from left to right External command is a file with a program
General Command/bin./usr/bin〈linux) Leftmost/: Indicates the root directory Other/: Represents the path delimiter
Administration command/sbin./usr/sbin〈windows) delimiter is usually \
Files with a. Start as hidden files
. : For the current directory
: The top level directory for the current directory
[[email protected] ~]#/etc/sysconfig/ localhost is also called local, and the correct explanation is: Native server
.:sysconfig is the current directory
...:/etc is the top-level directory of the current directory
First, Echo is a built-in command that you can use HELLP echo to get help information. -N: Turn off the wrap line feature
And-E as an escape character, you can make a blinking font that echoes-B: BACKSPACE delete key, etc.
The first number in brackets represents the foreground color, the second represents the background color, and 5 represents the flashing instruction.
[Email protected] ~]# echo-e "\033[43;32;5mhello zhangliang\033[0m"
Hello Zhangliang Flashing
[Email protected] ~]# echo-e "\033[43;31;5mhello zhangliang\033[0m"
Hello Zhangliang flashing
[Email protected] ~]# echo-e "\033[45;32;5mhello zhangliang\033[0m"
Hello Zhangliang Flashing
ii.pwd View the full path to the current working directory :
[Email protected] ~]# pwd
/root
[Email protected] ~]#
Use the PWD command to view the specified folder:
[Email protected] ~]# cd/opt/soft/
[Email protected] soft]# pwd
/opt/soft
[Email protected] soft]#
Cd-: Represents a switch back and forth between the previous directory and the current directory.
CD is change directory, changing working directory
Third, cat continuously display the contents of the file on the screen (connect text file)
cat-n textfile1 > Textfile2 Add a line number to the Textfile1 file, and then enter Textfile2. d in this file.
cat-b textfile1 textfile2 >> textfile3 Append the contents of the Textfile1 and Textfile2 files to the textfile3 after adding the line number (blank line not added).
file content in-view command
File/path/to/somewhere
Iv.ls:list displays a list of files under the specified path Ls-a show all files with hidden
Ls-a display except Band. and. Files Outside of
Ls-l long Format list detail file information
- wr- r-- r--
- representative file type
rw- file owner's permissions
r-- Permissions for a group of files
r-- Files Other users ' permissions do not include the owner and the group
Used to view the command type: type ls type type
The command must follow the specific format: exe. Mis. ELF. #file/bin/ls
This article is from the "11885756" blog, please be sure to keep this source http://11895756.blog.51cto.com/11885756/1833687
Linux Foundation Small module