A Linux terminal is not just a place to type commands. If you are familiar with these basic techniques, then you will be able to use the Bash shell that is used by default in most Linux distributions.
This is a special weapon that can not be forgotten when the primary user upgrades the monster.
1.Tab completion
This saves time and is handy for entering files and commands that you don't know exactly. For example, there is a file named "really long file name" in the current directory, you want to delete it. You can enter the full filename, but you must make sure that the spaces and each letter are entered correctly. If there are many files starting with the letter "r" in the current directory (if you don't type the characters correctly), Bash won't know which file you want to delete.
If there is another file named "really very long file name" in the current directory, you hit the Tab key. Bash will automatically supplement the "really\" section for all files starting with "r". At this point continue to hit the Tab key and you will get a list of all file names.
2. Pipeline mechanism
This mechanism allows you to pass the output of one command to another. According to the UNIX philosophy, each program is small enough to do just one thing and do it best. For example, the ls command lists all the files in the current directory, and the grep command searches for the specified search items in them.
You can combine the two by pipe mechanism (|character) to search for files in the current directory. The command given below (under the current folder) searches for a file with the keyword "word":
Ls | grep word
3. Wildcards
The "*" (asterisk) character is a wildcard that matches characters of any length. For example, if you want to delete two files named "really long file name" and "really very long file name" in the current folder, you can run the following command:
Rm really*name
This command deletes all files ending with "name" starting with "really". However, if you run the rm * command, you will delete all the files under the folder. (Be careful when using wildcards, especially if your rm does not have a -f confirmation!)
4. Output redirection
The ">" character redirects the output of one command to one file or another. For example, the following command will list all the files in the current folder after executing ls. The result is not displayed in the terminal, but output to a file named "file1" in the current folder:
Ls > file1
5. History
Bash can remember the commands you have entered before, and the up and down arrow keys can call them line by line. Use the history command to print the history and optionally output the results you want with the pipe mechanism grep.
~
.
..
"~", also known as a tilde, is used to indicate the current user's home directory. Instead of reaching your home directory via cd /home/name, you can type cd ~ to achieve the same effect. This can also be used on related paths: for example, cd ~/Desktop can reach the current user's Desktop directory.
Similarly, "." represents the current directory and ".." represents the parent directory of the current directory. Use cd .. to return to the previous directory. They can also be used in related paths. For example: You are currently in the Desktop folder. With the cd ../Documents command, you can go to the Documents folder that has the same parent folder as Desktop.
(Annotation: "-" represents the previous directory, cd - can be returned to the previous working directory.)
6. Background commands
Bash by default executes every command you type under the current terminal. Usually this is fine, but what if you want to continue using the terminal after launching an application? By launching Firefox by typing firefox, your terminal will be occupied by various information such as error prompts until you close the Firefox browser. In Bash you can execute programs in the background by adding the "&" operator at the end of the command.
Firefox &
7. Conditional execution
Bash can also execute two commands in succession. The second command will only begin execution after the first command has been successfully executed. To do this, you can type "&&", which is the two "&" characters, and enter two commands on the same line. The command given below will run the gnome-screenshot tool after waiting 5 seconds:
Sleep 5 && gnome-screenshot
Top Plug,Top Plug In,Standard Power Conversion Plug,Power Conversion Plug
WENZHOU TENGCAI ELECTRIC CO.,LTD , https://www.tengcaielectric.com