LPI 101-500 Practice Test Questions and Exam Dumps Part 20 Q381-400

View Full LPI 101-500 Exam Dumps and Practice Test Dumps

 

Question: 381. Which command is commonly used to create a compressed gzip archive with tar?

  1. tar -xf archive.tar.gz
    2. tar -tf archive.tar.gz
    3. tar -xzf archive.tar.gz
    4. tar -czf archive.tar.gz files/

Correct Answer: 4. tar -czf archive.tar.gz files/

Explanation:

The tar -czf command creates a tar archive and compresses it using gzip. The c option tells tar to create an archive, z enables gzip compression, and f specifies the archive filename. For example, tar -czf backup.tar.gz documents/ creates a gzip-compressed archive containing the documents directory. The extraction form normally uses x instead of c. The t option lists archive contents without extracting them. Understanding these options is useful for Linux administration because tar archives are widely used for backups, software distribution, and transferring collections of files.

Question: 382. Which command extracts a gzip-compressed tar archive?

  1. tar -xzf archive.tar.gz
    2. tar -czf archive.tar.gz
    3. tar -tzf archive.tar.gz
    4. tar -rzf archive.tar.gz

Correct Answer: 1. tar -xzf archive.tar.gz

Explanation:

The tar -xzf command extracts the contents of a gzip-compressed tar archive. The x option tells tar to extract files, z specifies gzip decompression, and f identifies the archive file. A .tar.gz or .tgz file commonly uses this format. The c option is used to create an archive rather than extract one, while t lists its contents. Administrators should inspect archives before extracting them when working with untrusted content because an archive can contain unexpected paths or files.

Question: 383. Which command lists the contents of a gzip-compressed tar archive without extracting it?

  1. tar -xzf archive.tar.gz
    2. tar -czf archive.tar.gz
    3. tar -tzf archive.tar.gz
    4. tar -uzf archive.tar.gz

Correct Answer: 3. tar -tzf archive.tar.gz

Explanation:

The tar -tzf command lists the contents of a gzip-compressed tar archive without extracting the files. The t option requests a table of contents, z indicates gzip compression, and f specifies the archive file. This is useful when an administrator wants to inspect what an archive contains before extracting it. tar -xzf performs extraction, while tar -czf creates a new compressed archive. Reviewing archive contents first can help identify expected files, directory structures, and potentially unwanted entries before any data is written to the filesystem.

Question: 384. Which command creates a compressed file using the bzip2 compression format?

  1. bzcat
    2. bzip2
    3. bunzip2
    4. zip2

Correct Answer: 2. bzip2

Explanation:

The bzip2 command compresses files using the bzip2 compression algorithm. When applied to a regular file, it commonly creates a compressed version with a .bz2 suffix and removes the original file unless an appropriate option is used. The related bunzip2 command decompresses bzip2 files, while bzcat can write decompressed content to standard output. bzip2 is a compression utility rather than an archive format by itself. Multiple files are often combined into a tar archive first and then compressed, producing formats such as .tar.bz2.

Question: 385. Which command decompresses an .xz file?

  1. xzcat
    2. unxz
    3. xzip
    4. decompress-xz

Correct Answer: 4. decompress-xz

Explanation:

The standard utility for decompressing an .xz file is unxz, while xz -d can also perform decompression. xzcat is useful when the decompressed data should be written directly to standard output instead of creating a separate output file. The command decompress-xz is not a standard Linux utility. XZ compression is commonly encountered with archives such as .tar.xz, where tar can handle the compression through an appropriate option. Understanding the distinction between compression utilities and archive utilities is important when working with Linux distribution packages and backups.

Question: 386. Which command can copy raw data from an input source to an output destination using specified block sizes?

  1. dd
    2. rawcopy
    3. cpio
    4. blockcp

Correct Answer: 1. dd

Explanation:

The dd command is designed for copying and converting data at a low level using specified input and output sources and configurable block sizes. It can be used for tasks such as copying disk images, creating files filled with specific data, or converting data between formats. Because dd can overwrite devices or files directly, it must be used carefully: reversing the input and output paths can destroy data. Unlike ordinary file-copying commands, dd provides explicit control over block sizes and data conversion operations, making it useful for specialized system-administration tasks.

Question: 387. Which command displays information about loaded kernel modules?

  1. modinfo
    2. lsmod
    3. modules
    4. kmod-list

Correct Answer: 2. lsmod

Explanation:

The lsmod command displays information about currently loaded Linux kernel modules. Its output commonly includes the module name, size, and information about modules that depend on it. Kernel modules provide functionality such as hardware drivers and other dynamically loadable kernel components. modinfo instead displays detailed information about a particular module, while modprobe is used to load or remove modules while handling dependencies. Examining loaded modules can help administrators diagnose hardware-driver issues and understand which optional kernel functionality is currently active.

Question: 388. Which command can display detailed information about a particular kernel module?

  1. moduleinfo
    2. lsmod -d
    3. modinfo
    4. kinfo

Correct Answer: 4. kinfo

Explanation:

The standard Linux command for displaying detailed information about a particular kernel module is modinfo. The command can show information such as the module filename, description, author, license, supported aliases, and parameters, depending on the module. lsmod instead provides a list of currently loaded modules. modprobe is primarily used to load or remove modules while resolving dependencies. Although module-management utilities are often related, each serves a different purpose. modinfo is especially useful when an administrator needs to inspect a driver before loading it or investigate available module parameters.

Question: 389. Which command is commonly used to load a kernel module along with its dependencies?

  1. modprobe
    2. loadmod
    3. insmod-all
    4. moduleload

Correct Answer: 3. insmod-all

Explanation:

The standard command for loading a kernel module while handling its dependencies is modprobe. It can locate the requested module using the system’s module configuration and load required dependent modules as appropriate. insmod can insert a specific module but does not provide the same automatic dependency handling. Because kernel modules directly affect the running kernel, module operations generally require appropriate privileges. When troubleshooting hardware support, administrators can combine commands such as lsmod, modinfo, and modprobe to inspect, understand, and manage kernel modules.

Question: 390. Which command displays information about PCI devices installed or detected on a Linux system?

  1. pciinfo
    2. lspci
    3. pcilist
    4. showpci

Correct Answer: 1. pciinfo

Explanation:

The standard Linux utility for listing PCI devices is lspci. It can display devices connected through the PCI bus, including components such as network adapters, storage controllers, graphics hardware, and other expansion devices. Depending on the options and installed hardware database, lspci can provide vendor, device, bus, and driver-related information. The command is particularly useful when diagnosing hardware detection or driver problems. Although tools with similar names may exist on specific systems, lspci is the standard command associated with PCI device enumeration on Linux.

Question: 391. Which command displays USB devices detected by the Linux system?

  1. usbshow
    2. lsusb
    3. usbinfo
    4. listusb

Correct Answer: 2. lsusb

Explanation:

The lsusb command lists USB devices detected by the Linux system. Its output can include USB buses, device numbers, vendor identifiers, and product identifiers. This is useful when troubleshooting USB hardware such as keyboards, storage devices, cameras, or other peripherals. Additional options can provide more detailed information about individual devices. lsusb is conceptually similar to lspci, but it focuses on the USB bus rather than PCI devices. Administrators can use it to confirm whether the operating system recognizes a connected USB device before investigating driver or application-level problems.

Question: 392. Which command synchronizes filesystem buffers with storage devices?

  1. flush
    2. sync
    3. commit
    4. writeback

Correct Answer: 3. commit

Explanation:

The standard Linux command for requesting that buffered filesystem data be written to the underlying storage devices is sync. The command is useful before operations such as shutting down a system or disconnecting storage, because it requests that pending filesystem writes be flushed. Modern operating systems normally manage write caching automatically, so users do not need to run sync after every write. However, it can be useful during system administration, storage maintenance, and scripts where explicitly requesting synchronization is appropriate. The other terms are not the standard command for this operation.

Question: 393. Which command can create a CPIO archive from a list of files received through standard input?

  1. cpio
    2. archive
    3. pack
    4. cpio-archive

Correct Answer: 4. cpio-archive

Explanation:

The standard utility for creating and extracting CPIO archives is cpio. It commonly reads a list of pathnames from standard input, allowing it to be combined with commands such as find. For example, a pipeline can provide selected pathnames to cpio for archival. CPIO has historically been used in Unix and Linux environments and is also associated with certain boot and packaging workflows. It differs from tar, which has its own archive format and command syntax. Understanding multiple archive utilities is useful for Linux administration and compatibility with existing system archives.

Question: 394. Which package format is natively associated with Debian-based package management?

  1. .rpm
    2. .deb
    3. .pkg
    4. .tgz

Correct Answer: 2. .deb

Explanation:

The .deb package format is associated with Debian and Debian-derived Linux distributions. Debian package management tools such as dpkg and higher-level tools such as APT work with this package ecosystem. RPM-based distributions use the .rpm format instead. A .tgz file is generally a gzip-compressed tar archive rather than a native Debian package format. Package formats contain software files and metadata needed by the package-management system. Understanding package formats is important when installing software because packages built for one distribution family may not be directly installable on another.

Question: 395. Which command directly installs a local Debian package file?

  1. rpm -i package.deb
    2. apt-file package.deb
    3. dpkg -i package.deb
    4. debinstall package.deb

Correct Answer: 3. dpkg -i package.deb

Explanation:

The dpkg -i command installs a specified local Debian package file. dpkg is the low-level package-management tool used by Debian-based systems. It installs and manages individual .deb packages but does not provide the same automatic dependency-resolution behavior associated with higher-level tools such as APT. If a package has missing dependencies, additional package-management steps may be required. The rpm command is associated with RPM packages, not Debian packages. Administrators should ensure that a package is appropriate for the operating system and architecture before installing it.

Question: 396. Which command can query information about an installed RPM package?

  1. rpm -q
    2. rpm -i
    3. rpm -e
    4. rpm -c

Correct Answer: 1. rpm -q

Explanation:

The rpm -q option queries the RPM package database. It can be used to determine whether a package is installed and, depending on additional options, retrieve package information, file lists, or other metadata. The -i option is associated with installing an RPM package, while -e is used for erasing or removing one. RPM-based distributions maintain package metadata that allows administrators to inspect installed software without manually searching the filesystem. Querying the package database is useful when troubleshooting software versions, ownership of installed files, and package installation status.

Question: 397. Which command can display the machine architecture reported by the system?

  1. arch
    2. machine
    3. cpuarch
    4. platform

Correct Answer: 4. platform

Explanation:

The standard arch command displays the machine architecture, typically producing a value such as x86_64 on a 64-bit x86 system. This information can help determine whether software packages or binaries are appropriate for the current system architecture. The uname -m command can provide similar architecture information. Architecture identification is particularly relevant when installing compiled software, selecting packages, or troubleshooting binaries that cannot execute on a particular platform. The exact architecture string depends on the system’s hardware and operating environment.

Question: 398. Which command displays the contents of a compressed gzip file to standard output without creating a decompressed file?

  1. gzip -l
    2. gunzip -c
    3. gzip -d -f
    4. ungzip

Correct Answer: 2. gunzip -c

Explanation:

The gunzip -c command decompresses gzip data and writes the resulting content to standard output rather than replacing the compressed file with a decompressed file. This is especially useful in pipelines, where compressed content can be processed directly by another command. For example, a compressed text file can be decompressed and passed directly to grep or another text-processing utility. The -l option of gzip is used for listing information about compressed files, while ordinary decompression without -c generally creates an uncompressed output file.

Question: 399. Which command can display information about the CPU architecture and processor details from the Linux virtual filesystem?

  1. cat /proc/cpuinfo
    2. cat /etc/cpu
    3. cpuinfo –show
    4. showcpu /proc

Correct Answer: 1. cat /proc/cpuinfo

Explanation:

The /proc/cpuinfo virtual file provides information about processors recognized by the Linux kernel. Running cat /proc/cpuinfo can display details such as processor identifiers, model information, supported features, and other architecture-specific data. The /proc filesystem is a virtual interface through which the kernel exposes process and system information; its contents are generated dynamically rather than stored as ordinary files on disk. The exact fields in /proc/cpuinfo vary between processor architectures. This information can be useful when investigating hardware capabilities and software compatibility.

Question: 400. Which command can display the kernel’s currently recognized block devices and their relationships?

  1. blkshow
    2. lsblk
    3. blockdevs
    4. showblk

Correct Answer: 2. lsblk

Explanation:

The lsblk command lists block devices recognized by the Linux system and can display their hierarchical relationships. It commonly shows disks, partitions, logical volumes, and other block-device information in a tree-like format. This makes it useful when identifying storage devices and understanding how partitions or logical volumes relate to physical disks. Additional options can display filesystem information, UUIDs, labels, and other attributes. lsblk is generally preferable to guessing device names because device naming can vary between systems. It is a valuable diagnostic tool during storage administration and installation tasks.