While writing a shell script to build an initramfs for a yet-to-be-booted kernel version 6.8.2-custom, you must programmatically obtain only the names of any kernel modules that the Intel driver i40e.ko depends on. Which single modinfo command satisfies this requirement?
The option -F depends tells modinfo to print just the value of the depends field. This makes the output easy for a script to parse. The -k 6.8.2-custom switch directs modinfo to inspect the module tree for that specific, non-running kernel. Therefore, the command modinfo -k 6.8.2-custom -F depends i40e meets all stated requirements.
Why the other commands are wrong:
Using --field license prints the module's license, not its dependencies.
Using the -p switch is shorthand for the parameters field, so it lists tunable parameters rather than required modules.
Piping the default modinfo output through grep depends is not ideal for scripting because it includes the depends: label in the output text, which requires extra parsing to isolate only the module names.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the `modinfo` command do?
Open an interactive chat with Bash
What is the purpose of the `-F` option in `modinfo`?
Open an interactive chat with Bash
Why is `-k` used in the `modinfo` command?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
System Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access