(reprinted) 10 Core Linux interview questions and answers

Source: Internet
Author: User
Tags integer numbers

1. Q: What should you do when you need to bind a macro or a key to a command?
A: You can use the bind command to bind a macro or key in a shell with ease.

In the key binding, we need to get the character sequence corresponding to the binding key.
For example, the acquisition of a F12 character sequence is as follows: Press CTRL + V first, and then press F12. We can get the F12 character sequence ^[[24~.
Bind is then used with bind.
[[email protected] ~]# bind ' "\e[24~": "Date" '
NOTE: The same keys may produce different character sequences under different terminals or terminal simulators.

"Attached" You can also use the SHOWKEY-A command to view a sequence of characters for a key.

2. Q: If a Linux novice wants to know the list of all commands supported by the current system, what does he need to do?
A: Using the command Compgen--c, you can print out a list of all supported commands.
[Email protected] ~]$ compgen-c
L.
ll
Ls
which
If
Then
Else
Elif
Fi
Case
Esac
For
Select
While
Until
Do
Done
...

3. Q: If your assistant wants to print out the current directory stack, what would you advise him to do?
A: Use the Linux command dirs to print the current directory stack.

[Email protected] ~]# dirs
/usr/share/x11
"Attached": the directory stack is operated by pushd POPD.

4. Q: Your system currently has a number of running tasks, what can be done to remove all running processes without restarting the machine?
A: Use the Linux command ' Disown-r ' to remove all running processes.

5. Q: What is the purpose of the hash command in the bash shell?

A: The Linux command ' hash ' manages a built-in hash table that records the full path of the executed command, which allows you to print out the commands you have used and the number of executions.
[[email protected] ~]# hash
Hits command
2/bin/ls

2/bin/su

6. Q: Which bash built-in command can perform mathematical operations.
A: The bash Shell's built-in commands let you perform mathematical operations on integer numbers.
#! /bin/bash
...
...
Let C=a+b
...
...

7. Q: How do I view the contents of a large file on a page-by-page?
A: The command "Cat File_name.txt" and the ' more ' are connected by a pipeline to achieve this need.

[email protected] ~]# Cat File_name.txt | More

8. Q: Which user does the data dictionary belong to?

A: The data dictionary belongs to the ' sys ' user, and the user ' sys ' and ' Sysem ' are automatically created by default by the system.

9. Q: How do I view a summary and usage of a Linux command?
Suppose you accidentally see a command in the/bin directory that you've never seen before, how do you know how it works and how it's used?
A: Using the command Whatis can show the use of this command briefly, for example, you can use Whatis zcat to see the introduction of ' Zcat ' and use briefly.
[Email protected] ~]# Whatis zcat
Zcat [gzip] (1) –compress or expand Files

10. Q: Which command can I use to see the disk space quotas for my file system?

A: Use the command Repquota to display quota information for a file system

"Attached" only the root user can view quotas for other users.

Original link: Avishek Kumar translation: Geek Van-He Weixian

Link: http://www.geekfan.net/8571/

[Reprint please keep the source, translator and translation links.] ]

(reprinted) 10 Core Linux interview questions and answers

Related Article

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.