It's time to read some serious content in a relaxed mood. This is another article about interview questions. We will show 10 Linux core questions, which will undoubtedly bring you closer to the first floor.
1. You need to define a macro and bind an existing command. What will you do?
A: In bash, a command called bind can be used to define a macro or bind a key. To bind an existing command, we need to generate the character sequence corresponding to that key. Click Ctrl + v, and then click F12. I get ^ [24 ~
[root@localhost ~]# bind ‘”\e[24~":"date"
Note: different terminals or terminal simulators may have different codes for the same key.
2. What are your suggestions for a Linux beginner who wants to know the complete list of available commands?
A: The 'compgen & shy; C' command displays all available commands.
[root@localhost ~]$ compgen -cl.lllswhichifthenelseelifficaseesacforselectwhileuntildodone…
3. Your assistant wants to print the directory stack. What are your suggestions?
A: The 'dirs' command prints the directory stack.
[root@localhost ~]# dirs/usr/share/X11
4. You have a lot of running jobs. How can you delete all running processes without restarting the machine?
A: The 'disown-R' command can delete all running processes.
5. What is the use of the 'hash' command in Bash?
A: The 'hash' command is used to manage the internal hash table. It is used to collect and record the full path of a specified command and display the command names and times used.
[root@localhost ~]# hashhits command 2 /bin/ls 2 /bin/su
6. Which linux built-in command can execute arithmetic operations in Bash?
A: The 'let' command can execute arithmetic operations in Bash.
#! /bin/bash......let c=a+b......
7. What if you have a large text file and want to view only one page at a time?
A: You can use the pipeline output of the 'cat file_name.txt 'And 'more' commands to achieve the above effect.
[root@localhost ~]# cat file_name.txt | more
8. Who owns the data dictionary?
Answer: 'sys' users have data dictionaries. Both 'sys' and 'sysem 'are automatically created by default.
9. In Linux, how do I know the overview and usage of a command?
Suppose you find a command in/bin and you have never noticed it. You have no idea what it is. How do you know what it does?
A: The 'whatis 'command displays the overview and usage of a command man page. For example, you want to see the overview of the 'zcat' command you didn't know before:
[root@localhost ~]# whatis zcatzcat [gzip] (1) - compress or expand files
10. What command can I use to know how many files and how much space each user has created under their quota?
A: The 'repquota 'command can solve this problem. It can generate a summary report for the file system.
This is all about it. Post your valuable comments in the comments! Next we will have more reports on Linux and Foss.