Curated

System Management

0 votes

Questions206

  1. Question 101

    System Management

    The volume group vg_data has two logical volumes, lv_db and lv_logs, and both have extents on /dev/sdb1. An administrator must move only the extents belonging to lv_db onto /dev/sdc1, which has enough free extents, and leave lv_logs where it is. Which command does this?

    Show the answer

    Correct answerA. pvmove -n lv_db /dev/sdb1 /dev/sdc1

    The -n option limits pvmove to the extents of the named logical volume, and the source PV comes before the destination PV. Omitting -n moves every allocated extent on /dev/sdb1, including those of lv_logs. Reversing the PVs would move data the wrong way.

    Open this question
  2. Question 102

    System Management

    A virtual machine uses the whole disk /dev/sdb as a physical volume in vg_data. The hypervisor administrator has grown the virtual disk from 50 GiB to 100 GiB and the guest kernel already reports the new size. vgs still shows no additional free space in vg_data. Which command makes the new capacity available to the volume group?

    Show the answer

    Correct answerC. pvresize /dev/sdb

    pvresize updates the PV metadata to the device's new size, which adds free extents to vg_data. vgextend fails because /dev/sdb is already a member of the volume group. lvextend cannot use space the volume group does not yet have, and pvscan only refreshes the list of PVs.

    Open this question
  3. Question 103

    System Management

    A technician reuses a retired disk partition, /dev/sdd1, that previously held an ext4 filesystem whose data is no longer needed. Running pvcreate /dev/sdd1 stops with a prompt saying an ext4 signature was detected and asking whether to wipe it. What should the technician do to initialize the partition as a physical volume?

    Show the answer

    Correct answerC. Answer y so pvcreate wipes the old signature and writes the LVM label

    Because the old data is not needed, confirming the wipe lets pvcreate clear the ext4 signature and write the LVM label. Answering n aborts the initialization, and LVM never converts a filesystem in place. Shrinking the filesystem or running pvscan does not remove the signature.

    Open this question
  4. Question 104

    System Management

    While a pvmove from /dev/sdb1 to /dev/sdc1 was running, the server lost power. After the reboot, lvs -a shows a hidden [pvmove0] volume in vg_data, and some extents are still on /dev/sdb1. The administrator wants the migration to finish. Which command does this?

    Show the answer

    Correct answerB. pvmove with no arguments

    Running pvmove with no arguments restarts any interrupted move from where it stopped and completes it. pvmove --abort is tempting but cancels the operation and leaves the extents split between both PVs. vgreduce --removemissing deals with absent PVs, which is not the situation here.

    Open this question
  5. Question 105

    System Management

    A cloud provider enlarges the virtual disk /dev/nvme0n1. Partition 3 is the last partition on the disk, and the administrator wants the partition itself extended to fill the new space. Which command does this?

    Show the answer

    Correct answerD. growpart /dev/nvme0n1 3

    growpart takes the disk device and the partition number as separate arguments, so growpart /dev/nvme0n1 3 extends the partition. Passing the partition node (nvme0n1p3) as a single argument is invalid syntax. resize2fs grows a filesystem, not a partition.

    Open this question
  6. Question 106

    System Management

    An administrator adds a new 4 TB disk, /dev/sdd, to a server. The disk has no partition table, and one partition must use the entire disk. Which command set BEST accomplishes this?

    Show the answer

    Correct answerB. Run parted /dev/sdd mklabel gpt, then parted /dev/sdd mkpart primary 0% 100%

    A GPT label supports disks larger than 2 TiB, and mkpart with 0% 100% spans the whole disk. An msdos (MBR) label is the tempting choice, but it cannot address more than 2 TiB, so most of the disk would be unusable.

    Open this question
  7. Question 107

    System Management

    On an MBR disk, an administrator has created /dev/sdb1 with fdisk and now needs it marked as a Linux LVM partition before running pvcreate. Which interactive fdisk sequence, followed by w to save, makes this change?

    Show the answer

    Correct answerD. Press t, select partition 1, then enter the type code 8e

    The t command changes a partition's type, and 8e is the Linux LVM type code on an MBR disk. The a command only toggles the bootable flag, and l and p merely list type codes and partitions without changing anything.

    Open this question
  8. Question 108

    System Management

    An administrator must write /etc/fstab entries that use UUIDs. They want one command that shows each disk and its partitions in a tree, along with each filesystem's type and UUID. Which command BEST meets this need?

    Show the answer

    Correct answerB. lsblk -f

    lsblk -f lists block devices in a tree with filesystem type, label, UUID and mount point. parted -l shows partition tables and filesystem types but not filesystem UUIDs, and df -T lists only mounted filesystems without UUIDs.

    Open this question
  9. Question 109

    System Management

    A partition listed in /etc/fstab by UUID is reformatted with mkfs.ext4. What happens to the UUID that blkid reports for its filesystem?

    Show the answer

    Correct answerA. It changes, because mkfs generates a new filesystem UUID

    AWhy this is right: The filesystem UUID is created by mkfs, so reformatting gives a new one and fstab must be updated.

    BWhy not this: The partition table holds the PARTUUID, which does not change; the filesystem UUID does.

    CWhy not this: The filesystem UUID is generated by mkfs, not taken from the disk's serial number.

    DWhy not this: mkfs.ext4 assigns a UUID itself; tune2fs is needed only to change it.

    A filesystem UUID is generated when the filesystem is created, so running mkfs again produces a new one. The partition keeps its device name and its PARTUUID, but entries in /etc/fstab that use the old filesystem UUID must be updated.

    Open this question
  10. Question 110

    System Management

    An administrator is formatting a general-purpose data volume that may need to be made smaller later. Which filesystem choice supports this, and why?

    Show the answer

    Correct answerC. ext4, because resize2fs can shrink it while it is unmounted

    AWhy not this: resize2fs can grow a mounted ext4 filesystem, but shrinking ext4 requires it to be unmounted.

    BWhy not this: xfs_fsr defragments XFS files; it does not change the filesystem's size, and XFS cannot be shrunk.

    CWhy this is right: Ext4 can be shrunk with resize2fs once it is unmounted, while XFS can only be grown.

    DWhy not this: xfs_repair checks and repairs XFS metadata; it cannot shrink the filesystem.

    XFS can be grown but cannot be shrunk, whereas ext4 can be shrunk while unmounted using resize2fs. Choosing XFS for a volume that may need to shrink would force a backup, recreate and restore.

    Open this question
  11. Question 111

    System Management

    An administrator mounts a tmpfs filesystem at /mnt/scratch with the option size=1g and then writes 300 MB of files to it. Which statement BEST describes how that data is stored?

    Show the answer

    Correct answerA. It is held in virtual memory, uses only the space needed, and is lost at unmount or reboot

    Tmpfs is backed by virtual memory (RAM and possibly swap), consumes only what the files need up to the size limit, and its contents vanish on unmount or reboot. It does not pre-allocate the full size, which is the tempting misconception.

    Open this question
  12. Question 112

    System Management

    A systems administrator is preparing a test server that receives frequent package and configuration changes. The administrator wants to take point-in-time snapshots before each update and have data checksummed, and also wants transparent compression, all from the filesystem itself without adding LVM. Which filesystem format BEST meets these requirements?

    Show the answer

    Correct answerB. btrfs

    Btrfs is copy-on-write and provides native snapshots, subvolumes, data and metadata checksums, and transparent compression. Ext4 is a reliable journaling filesystem but has no built-in snapshots or data checksumming, so it would need LVM or other tools.

    Open this question
  13. Question 113

    System Management

    An administrator has extended the logical volumes under a mounted XFS filesystem at /data (/dev/vg0/data) and a mounted ext4 filesystem at /srv (/dev/vg0/srv). Which commands grow both filesystems without unmounting either one?

    Show the answer

    Correct answerA. xfs_growfs /data, then resize2fs /dev/vg0/srv

    AWhy this is right: xfs_growfs grows mounted XFS by mount point, and resize2fs grows mounted ext4 online.

    BWhy not this: The tools are swapped; resize2fs cannot resize XFS and xfs_growfs cannot resize ext4.

    CWhy not this: Growing ext4 works while mounted, so unmounting /srv is not needed.

    DWhy not this: resize2fs handles only the ext family, so it cannot grow the XFS filesystem.

    xfs_growfs works only on a mounted XFS filesystem and takes the mount point. resize2fs supports online growth of a mounted ext4 filesystem. Only shrinking ext4 requires unmounting, and XFS cannot be shrunk.

    Open this question
  14. Question 114

    System Management

    The kernel log shows I/O errors for an ext4 filesystem on /dev/sdc1, which is mounted at /data. Which action checks and repairs the filesystem safely?

    Show the answer

    Correct answerC. Unmount /data, then run fsck.ext4 -f /dev/sdc1

    A filesystem must be unmounted before fsck.ext4 repairs it, and a forced check covers ext4 metadata. Running a repair on a mounted filesystem is tempting to avoid downtime but can corrupt data. xfs_repair is for XFS only, and resize2fs changes size, not integrity.

    Open this question
  15. Question 115

    System Management

    An administrator must measure how many 4 KiB random read operations per second the volume mounted at /data can sustain. The results must reflect the storage device rather than the page cache. Which command does this?

    Show the answer

    Correct answerA. fio --name=t --filename=/data/t.fio --rw=randread --bs=4k --size=1g --direct=1

    --rw=randread with --bs=4k generates small random reads, and --direct=1 bypasses the page cache so the device is measured. The tempting --direct=0 variant uses buffered I/O, so cached data inflates the results. The others test sequential reads or large blocks, which measure throughput.

    Open this question
  16. Question 116

    System Management

    An administrator must reformat /dev/sdd1, which holds an old ext4 filesystem that is no longer needed, as XFS. Running mkfs.xfs /dev/sdd1 stops with a message that an existing filesystem was found. Which command creates the XFS filesystem over it?

    Show the answer

    Correct answerC. mkfs.xfs -f /dev/sdd1

    mkfs.xfs -f forces creation of a new XFS filesystem over an existing signature. mkfs.ext4 -F also forces overwriting, but it would create ext4 rather than XFS. xfs_repair and xfs_growfs act only on existing XFS filesystems.

    Open this question
  17. Question 117

    System Management

    The /var filesystem on a server is filling up. An administrator wants to see how full the filesystem is and which directories under /var use the most space. Which three commands provide this information? (Choose three.)

    Choose 3 answers

    Show the answer

    Correct answersA. du -sh /var/*C. du -h --max-depth=1 /var | sort -rhE. df -hT /var

    df -hT reports size, used and available space for the filesystem holding /var, and du with a depth limit or a wildcard totals each directory. The tempting fsck -N only prints what a check would do, and fio benchmarks I/O. Neither reports usage.

    Open this question
  18. Question 118

    System Management

    A technician has four unused partitions, /dev/sdb1 through /dev/sde1. The company needs a RAID 5 array that uses three partitions as active members and keeps the fourth as a hot spare that is rebuilt into the array automatically if a member fails. Which command creates this array?

    Show the answer

    Correct answerD. mdadm --create /dev/md0 --level=5 --raid-devices=3 --spare-devices=1 /dev/sd[b-e]1

    --raid-devices=3 sets three active members and --spare-devices=1 leaves the fourth partition as a hot spare. Making all four devices active would leave no spare. RAID 6 needs at least four active devices, and --assemble only starts an existing array.

    Open this question
  19. Question 119

    System Management

    An administrator runs cat /proc/mdstat and sees this for md0: "active raid5 sde1[3] sdd1[2] sdc1[1] sdb1[0] ... [4/4] [UUUU]" followed by a progress bar showing "resync = 28.4% finish=42.1min". What does this output indicate?

    Show the answer

    Correct answerB. All four members are active and parity is being synchronized while the array stays online

    [4/4] [UUUU] shows every member is present and up, and resync means the members are being brought into consistency, which is normal after creation or an unclean shutdown. A rebuild onto a spare would show a degraded state such as [U_] and the word recovery. A reshape would be labelled reshape.

    Open this question
  20. Question 120

    System Management

    A RAID 1 array was created as /dev/md0 and works correctly. After each reboot it comes up as /dev/md127 and the application mount point fails. Which action BEST makes the array assemble with the name md0 at every boot?

    Show the answer

    Correct answerD. Append the output of mdadm --detail --scan to the mdadm configuration file and rebuild the initramfs

    An ARRAY line in the mdadm configuration file ties the array's identity to the name md0, and rebuilding the initramfs makes early boot use it. An fstab entry only mounts the filesystem and does not set the device name. Running --examine --scan only prints information and writes nothing.

    Open this question
  21. Question 121

    System Management

    The /etc/auto.master file contains the line "/shares /etc/auto.shares". An administrator wants an access to /shares/reports to mount the NFS export nfs01:/export/reports read-only on demand. Which line belongs in /etc/auto.shares?

    Show the answer

    Correct answerD. reports -fstype=nfs,ro nfs01:/export/reports

    In an indirect map, the key is the subdirectory name relative to the master map mount point, followed by -fstype and options, then the server:path location. The full-path key is tempting, but indirect map keys must not include the parent path.

    Open this question
  22. Question 122

    System Management

    A technician must make the contents of /srv/shared appear at /home/ftp/shared for an FTP service. Both paths are on the local ext4 root filesystem, and the data must not be copied or duplicated. Which command does this?

    Show the answer

    Correct answerA. mount --bind /srv/shared /home/ftp/shared

    A bind mount makes an existing directory tree visible at a second path without copying data. The --move option is tempting but only relocates an existing mount point, and /srv/shared is not one here.

    Open this question
  23. Question 123

    System Management

    A Windows file server named fs01 publishes a share called finance over SMB. A Linux administrator must mount it at /mnt/finance, supplying the credentials stored in /root/.smbcreds. Which command does this?

    Show the answer

    Correct answerC. mount -t cifs //fs01/finance /mnt/finance -o credentials=/root/.smbcreds

    SMB shares use the cifs filesystem type with //server/share syntax, and the credentials option reads a credentials file. The NFS type is wrong for an SMB share, and smbfs is a long-obsolete type replaced by cifs.

    Open this question
  24. Question 124

    System Management

    After adding a new entry to /etc/fstab, how can an administrator test it without rebooting?

    Show the answer

    Correct answerA. Run mount -a, which mounts every listed filesystem that is not already mounted

    AWhy this is right: mount -a tries every fstab entry not yet mounted, except noauto ones, so a bad new entry shows up now.

    BWhy not this: mount -l lists currently mounted filesystems; it does not check fstab entries.

    CWhy not this: swapon -a activates only the swap entries in fstab.

    DWhy not this: fsck -A checks the filesystems for errors; it does not mount them.

    mount -a processes /etc/fstab and mounts all entries not already mounted, except those marked noauto. This exposes typos in a new entry before the next boot, which is why it is the standard check.

    Open this question
  25. Question 125

    System Management

    A server has an /etc/fstab entry that mounts a secondary disk at /mnt/archive. When the disk is absent, boot stalls and drops to emergency mode. The disk must still mount automatically whenever it is present. Which mount option should be added to the entry?

    Show the answer

    Correct answerA. nofail

    nofail lets boot continue without error if the device is missing, while still mounting it when present. noauto also avoids the boot failure but stops the disk from mounting automatically at boot, which breaks the requirement.

    Open this question
  26. Question 126

    System Management

    An administrator runs stat on a file on an ext4 filesystem. The output lists the inode number, owner, permissions, size and timestamps. The administrator wants to know where the filename itself is recorded. Which answer is correct?

    Show the answer

    Correct answerA. In a directory entry that maps the name to an inode

    A filename lives in a directory entry that maps the name to an inode number; the inode holds metadata such as owner, permissions, size, timestamps and block pointers. The inode does not store the name, which is why one inode can have several names.

    Open this question
  27. Question 127

    System Management

    A mail server stores millions of tiny files on an ext4 filesystem. File creation fails even though many free blocks remain. Which statement BEST explains why the filesystem can run out of inodes while blocks are still free?

    Show the answer

    Correct answerC. The inode count is fixed at format time and each file uses one

    ext4 creates a fixed inode table at mkfs time (set by the bytes-per-inode ratio), and every file or directory consumes one inode regardless of size. Inodes are not allocated dynamically from free blocks, so many tiny files can exhaust inodes first.

    Open this question
  28. Question 128

    System Management

    On a server, df -i shows IUse% at 100% for the filesystem mounted at /var, while df -h shows plenty of free blocks. Which command best identifies which top-level directory under /var holds the most inodes?

    Show the answer

    Correct answerC. du --inodes --max-depth=1 /var | sort -n

    du --inodes (GNU coreutils) counts inodes instead of blocks, so sorting its per-directory output shows which directory holds the most files. du -h --max-depth=1 reports block usage, so millions of tiny files can look small. tune2fs -l shows only filesystem-wide inode totals, not a per-directory breakdown.

    Open this question
  29. Question 129

    System Management

    An administrator adds the line 10.0.0.25 build01 to /etc/hosts on a server whose /etc/nsswitch.conf lists files before dns for hosts. What must be done before lookups of build01 return the new address?

    Show the answer

    Correct answerA. Nothing more, because the resolver reads /etc/hosts on each lookup

    AWhy this is right: glibc reads /etc/hosts on every lookup through the files source, so the saved edit applies at once.

    BWhy not this: NetworkManager does not serve lookups from /etc/hosts; the resolver library reads the file directly.

    CWhy not this: hostnamectl sets the machine's own hostname; it does not register entries for other hosts.

    DWhy not this: glibc keeps no boot-time copy of /etc/hosts, so no reboot is needed.

    The resolver library reads /etc/hosts each time a lookup uses the files source, so a saved edit applies at once. The tempting belief that a service restart or reboot is needed applies to DNS client configuration managed by other tools, not to this plain-text file.

    Open this question
  30. Question 130

    System Management

    A server has the line "10.1.1.5 app.example.com" in /etc/hosts, while DNS returns 10.1.1.9 for the same name. The hosts entry in /etc/nsswitch.conf reads "hosts: dns files". Which address does the command getent hosts app.example.com return?

    Show the answer

    Correct answerC. 10.1.1.9, because dns is listed before files and answers the query

    The hosts line in /etc/nsswitch.conf sets the source order, and lookup stops at the first source that returns an answer. Here dns is first, so 10.1.1.9 is returned. The belief that /etc/hosts always wins is only true when files is listed first, as in the common default.

    Open this question
  31. Question 131

    System Management

    An administrator added the line "web01.example.com 10.0.5.20 web01" to /etc/hosts. The name web01 still does not resolve. Which corrected line is valid?

    Show the answer

    Correct answerB. 10.0.5.20 web01.example.com web01

    Each /etc/hosts line must start with the IP address, then the canonical hostname, then optional aliases, all separated by whitespace. Putting the name first still leaves the address in the wrong field. Commas or equals signs are not valid separators in this file.

    Open this question
  32. Question 132

    System Management

    A RHEL server uses NetworkManager. An administrator adds a nameserver line to /etc/resolv.conf, but the line is gone after the next reboot. Which action BEST makes the DNS server setting persistent?

    Show the answer

    Correct answerB. Set the DNS server on the connection profile with nmcli connection modify and the ipv4.dns property

    NetworkManager regenerates /etc/resolv.conf from the connection profile, so the DNS server must be set in the profile, for example with nmcli and ipv4.dns. Changing permissions is tempting, but root-owned services can still replace the file, and it leaves the profile wrong.

    Open this question
  33. Question 133

    System Management

    A server lists two nameservers in /etc/resolv.conf. When the first server is unreachable, every lookup stalls for several seconds before the second server is tried. Which addition to /etc/resolv.conf BEST shortens this delay?

    Show the answer

    Correct answerB. options timeout:1

    The timeout option sets how many seconds the resolver waits for a reply from a nameserver before trying the next one, so a lower value shortens the stall. The rotate option only spreads queries across servers, so some lookups would still wait on the dead one.

    Open this question
  34. Question 134

    System Management

    An administrator must give a server's wired interface ens192 a static address on a new NetworkManager profile named office-lan. The address is 192.168.10.25/24, the gateway is 192.168.10.1, and the profile must not use DHCP. Which command sequence creates the profile correctly?

    Show the answer

    Correct answerB. nmcli connection add type ethernet ifname ens192 con-name office-lan ipv4.method manual ipv4.addresses 192.168.10.25/24 ipv4.gateway 192.168.10.1

    A static profile uses ipv4.method manual with an address and gateway, created with nmcli connection add. The device modify command is tempting but only changes the live settings of an existing device; it does not create a new saved profile, and office-lan is not a device name. The auto method would keep DHCP in use.

    Open this question
  35. Question 135

    System Management

    A profile named office-lan already exists and is active on ens192. An administrator changes its DNS server with the command nmcli connection modify office-lan ipv4.dns 10.0.0.53. The change is saved, but the running system still resolves names with the old DNS server. Which action applies the change with the least disruption to other connections?

    Show the answer

    Correct answerD. Run nmcli connection up office-lan to reapply the profile

    nmcli connection modify only edits the stored profile; activating it again with connection up applies the new settings to ens192 only. A reload rereads profile files from disk but does not reapply them to an active device, so it is tempting yet insufficient. Toggling networking disrupts every connection.

    Open this question
  36. Question 136

    System Management

    An administrator is changing the network settings of a remote server over SSH and wants the automatic rollback window shortened from the default 120 seconds to 30 seconds. Which command does this?

    Show the answer

    Correct answerD. sudo netplan try --timeout 30

    netplan try accepts --timeout to set how many seconds it waits for confirmation before reverting. netplan apply is tempting but applies changes immediately with no rollback and has no timeout option.

    Open this question
  37. Question 137

    System Management

    An administrator has just applied a new configuration on an Ubuntu server and wants to confirm the addresses, routes, and backend that each interface is actually using right now. Which command shows this runtime state?

    Show the answer

    Correct answerB. netplan status

    netplan status reports the live state of each interface, including addresses, routes, and the backend managing it. netplan get is tempting but only prints the merged YAML configuration as written, not what is running on the system.

    Open this question
  38. Question 138

    System Management

    netplan apply fails with a parse error after an administrator edits /etc/netplan/01-netcfg.yaml. The keys and values are correct. What is a likely cause?

    Show the answer

    Correct answerB. Some lines are indented with tab characters

    AWhy not this: YAML accepts any consistent number of spaces per level, so two spaces is valid.

    BWhy this is right: YAML does not allow tabs for indentation, so a tab causes a parse error.

    CWhy not this: Netplan reads *.yaml files in /etc/netplan; .yaml is the expected extension.

    DWhy not this: YAML supports comments that begin with #, so they do not cause a parse error.

    YAML forbids tabs for indentation, so Netplan files must use spaces, and a tab causes a parse error. The idea that tabs are accepted as equivalent to spaces is a common misconception carried over from other configuration formats.

    Open this question
  39. Question 139

    System Management

    A server's eth1 interface already carries 192.168.60.10/24. The server must also answer on 192.168.60.5/24 on the same interface while keeping the existing address. The change only needs to last until the next reboot. Which command does this?

    Show the answer

    Correct answerB. ip address add 192.168.60.5/24 dev eth1

    ip address add attaches an additional IPv4 address to the interface without touching the existing one, and it is not persistent. ip link set ... address changes the MAC address, not an IP address, so it is wrong here.

    Open this question
  40. Question 140

    System Management

    An administrator runs tcpdump -i eth0 -w capture.pcap port 53. What does the command produce?

    Show the answer

    Correct answerD. A binary pcap file of DNS packets on eth0 that tcpdump -r can read later

    AWhy not this: -w writes raw binary packet data, not decoded text, so cat does not show readable output.

    BWhy not this: The port 53 filter applies at capture time, so only DNS packets are written to the file.

    CWhy not this: With -w, tcpdump writes packets to the file instead of printing them to the screen.

    DWhy this is right: -w saves raw DNS packets captured on eth0 to a pcap file, and tcpdump -r reads it back.

    The -w option writes raw packets to a pcap file, the port 53 filter limits capture to DNS traffic, and -r reads the file back. It is tempting to think -w prints readable text to the file, but it stores binary packet data.

    Open this question
  41. Question 141

    System Management

    During an investigation, an administrator needs a numeric list of only the established TCP connections whose remote port is 443. Which command produces this?

    Show the answer

    Correct answerB. ss -tn state established '( dport = :443 )'

    The -t option selects TCP, -n keeps output numeric, and the dport filter matches the remote port of established sockets. Adding -l restricts output to listening sockets, so combining it with an established-state filter would show nothing useful.

    Open this question
  42. Question 142

    System Management

    An administrator must find which hostname DNS associates with the IP address 198.51.100.25, using one dig command. Which command does this?

    Show the answer

    Correct answerD. dig -x 198.51.100.25

    dig -x builds the in-addr.arpa name itself and queries the PTR record for the address. Using PTR with the plain address queries a nonexistent name literally, and -x with an already reversed arpa name would reverse it a second time.

    Open this question
  43. Question 143

    System Management

    Which four statements about connectivity and path-testing tools on a Linux system are correct? (Choose four.)

    Choose 4 answers

    Show the answer

    Correct answersA. traceroute sends UDP datagrams to high-numbered ports by defaultB. mtr combines ping and traceroute behavior in a continuously updating displayC. ping -c 4 sends four ICMP echo requests and then exitsE. tracepath can trace a path without root privileges and reports the path MTU

    AWhy this is right: Linux traceroute sends UDP probes to high ports by default.

    BWhy this is right: mtr runs ping and traceroute together and updates its display continuously.

    CWhy this is right: -c sets the number of echo requests, so ping stops after four.

    DWhy not this: -I selects ICMP echo probes; TCP SYN probes use -T.

    EWhy this is right: tracepath runs without root and reports the path MTU.

    FWhy not this: On Linux, ping -t sets the TTL of each packet; -w sets a time limit.

    tracepath needs no privileges and reports PMTU, traceroute defaults to UDP probes, mtr merges ping and traceroute, and ping -c limits the count. traceroute -I selects ICMP echo probes; TCP SYN probes use -T. On Linux, ping -t sets the TTL; a time limit uses -w.

    Open this question
  44. Question 144

    System Management

    A Linux administrator has a script, setenv.sh, that contains 'export DB_HOST=db01.example.com'. After running the script from an interactive terminal, 'echo $DB_HOST' prints an empty line. The administrator needs DB_HOST to be set in the current shell session. Which action BEST meets the requirement?

    Show the answer

    Correct answerB. Run the script with source ./setenv.sh

    Sourcing runs the script's commands inside the current shell, so the exported variable stays set there. Running it with bash or ./ starts a child process, and a child's exported variables are lost when it exits, which is why making it executable does not help.

    Open this question
  45. Question 145

    System Management

    LANG in an interactive Bash shell is en_US.UTF-8. The administrator runs LANG=C sort names.txt and then echo $LANG. What does echo print?

    Show the answer

    Correct answerB. en_US.UTF-8

    AWhy not this: LANG=C applied only to the sort command; the shell's own LANG was not changed.

    BWhy this is right: An assignment before a command sets it only for that command, so the shell keeps en_US.UTF-8.

    CWhy not this: The prefix assignment does not unset LANG in the shell; it keeps its earlier value.

    DWhy not this: C.UTF-8 is a different locale and was never assigned; the shell keeps en_US.UTF-8.

    A variable assignment placed directly before a command applies only to that command's environment for its duration. The current shell's LANG is not modified, so it differs from running export LANG=C, which changes the shell and its later child processes.

    Open this question
  46. Question 146

    System Management

    An administrator's shell is in /var/www/html/app/config. She must open /var/www/html/shared/settings.conf using a relative path rather than an absolute one. Which path correctly refers to that file?

    Show the answer

    Correct answerB. ../../shared/settings.conf

    Two .. components move from config up to app and then to /var/www/html, where shared/settings.conf lives. A single .. stops at /var/www/html/app, so it would point to app/shared/settings.conf, which is the wrong location.

    Open this question
  47. Question 147

    System Management

    User mara is working in /srv/data. She runs the command cd ~/reports/../archive, and every directory in the path exists. What is her working directory afterward?

    Show the answer

    Correct answerC. /home/mara/archive

    The tilde expands to her home directory, /home/mara, so the path is absolute. The .. then cancels reports, leaving /home/mara/archive. The current directory /srv/data plays no part, which rules out the /srv/data/archive option.

    Open this question
  48. Question 148

    System Management

    A Linux administrator wants a custom alias to be available every time a user opens a new terminal window in a graphical desktop session, where each terminal starts an interactive non-login Bash shell. The alias must apply only to this user. Which file should the administrator edit?

    Show the answer

    Correct answerB. ~/.bashrc

    ~/.bashrc is read by interactive non-login Bash shells, such as a terminal opened in a desktop session, and is per-user. ~/.bash_profile is read only by login shells, so an alias placed there would not load in new terminal windows.

    Open this question
  49. Question 149

    System Management

    A user connects to a server over SSH and finds that a PATH change they added to ~/.bashrc is missing in the session, even though it works when they run bash from the prompt. The user's home directory contains both ~/.bash_profile and ~/.profile, and Bash is the login shell. Which file is Bash reading first for this login session?

    Show the answer

    Correct answerC. ~/.bash_profile

    A Bash login shell reads ~/.bash_profile first and, if it exists, skips ~/.bash_login and ~/.profile. It does not read ~/.bashrc unless ~/.bash_profile sources it. ~/.profile is tempting, but it is used only when the other two login files are absent.

    Open this question
  50. Question 150

    System Management

    A Bash script writes a configuration block with cat <<EOF inside an indented if statement. The closing EOF is indented with tab characters, so the shell never finds the delimiter and warns that the here-document ended at end-of-file. Which change fixes the problem while keeping the indentation?

    Show the answer

    Correct answerA. Change << to <<- so leading tabs are stripped

    The <<- operator strips leading tab characters from the body and from the closing delimiter, so an indented delimiter is recognized. Quoting the delimiter only disables variable expansion and does not affect how the closing line is matched.

    Open this question