1. How to clear the screen? How do I exit the current command? How to perform sleep? How do I check the current user ID? What commands are used to view specified help?
Answer: Clear screen: clear
Exit the current command: Ctrl+C to exit completely.
Perform Sleep : Ctrl+Z suspends the current process in the background of FG recovery.
View the current user ID: "ID": View the UID and GID of the account that you are currently logged into, and the group and user name to which it belongs.
Check out the specified help: for example, man adduser this is very complete and there are examples; adduser --help This tells you some common parameters; info adduesr;
2. Establish soft links (shortcuts) and hard link commands.
Answer: Soft link: ln -s slink source
Hard link: LN link source
3. What commands can be used to view the content of a file?
Answer: vi File name can be viewed in edit mode, which can be modified.
cat filename Displays the entire file contents.
more The filename tab displays the contents of the file.
The less filename is similar to more, but better yet, you can turn the page forward.
tail filename only looks at the tail and you can also specify the number of rows.
head filename only looks at the head, you can also specify the number of rows.
4. What kinds of wildcards can be used for Linux commands? What do they mean?
Answer: "? It can be used to replace a single character.
You can override any number of characters.
5. What command is used to count the content of a file? (line number, number of words, number of bytes).
Answer: wc command - c count bytes - l count lines - w count words.
6. How do I make a command run in the background?
Answer: It is common to use & at the end of the command to make the program run automatically. (You can not append a space after the command).
7. What commands are used to transfer background tasks to the foreground for execution? What commands do I use to execute a stopped background task in the background?
Answer: Bring background tasks to the foreground to execute fg
Execute stopped background tasks in the background bg
8. What command do I use to search for files? What is the format?
Answer: Find "Specified Catalog" "Specified Conditions" "Specified Actions".
whereis plus the parameter and the file name.
locate only adds the file name.
find searches the disk directly, which is slower.
find / -name "string*"
9. What command can I use to view the list of used commands?
Answer: history
10. Where can I find the executable file of the search command? How do I set it up and add it?
Answer: whereis [-bfmsu][-b "Table of Contents".m Table of Contentss Table of ContentsFile.
11. What command can be used to find the execution command?
Answer: which can only look up executables.
whereis can only look up binaries, documentation, source files, etc.
12. What should you do when you need to bind a macro or key to a command?
Answer: You can use the bind command, bind can be easily implemented in the shell to implement macro or key binding.
When performing key binding, we need to first obtain the character sequence corresponding to the bound key.
For example, the method to obtain the character sequence of F12 is as follows: first press Ctrl+V, then press F12We can get the character sequence of f12 [24].
Bind is then used.
root@localhost ~]# bind ‘”e[24~":"date"'
Note: The same key may produce different sequences of characters in different terminals or terminal emulators.
P.S. You can also use the showkey -a command to view the sequence of characters corresponding to the key.
13. Your system currently has many running tasks, is there any way to remove all running processes without restarting the machine?
Answer: Use the Linux command 'disown -r' to remove all running processes.
14. How to check the summary and usage of a Linux command? Suppose you stumble upon a command in the bin directory that you have never seen before, how do you know what it does and how to use it?
Answer: You can use the command whatis to show a brief description of the usage of this command, for example, you can use whatis zcat to see the introduction of 'zcat' and the brief use of it.
#linux#