Skip to content

WA4. More Linux Commands

Answers

1. Type the following command and list and describe the output lsblk

  • The lsblk command lists information about all available or specified block devices. The information includes the device name, size, type, mount point, and other information. The command can be used to list all block devices or only the ones of a specific type. The command can also be used to list information about a specific block device (Linux manual, lsblk (8)).

lsblk

2. From the information gathered in the first command output the contents of the disk scheduler for one of your disks using the cat command cat /sys/block/<disk>/queue/scheduler

  • I displayed the scheduler information for the xvda disk using the following command cat /sys/block/xvda/queue/scheduler and the output is as follows:

cat xvda

3. find the fstab configuration file using the find command. Show your command and the output

  • First I tried the command find as follows find / -name fstab but it failed with permission denied error.

find fstab

  • Then I retried with sudo sudo find / -name fstab and it worked as follows:

find fstab

  • The content of /etc/fstab is as follows:

fstab

  • The find command accepts the following arguments:
    • The starting point of the search, in this case / which is the root directory.
    • option that we perform the search with, in this case -name which is used to search for files with a specific name.
    • Search needle which is the name of the file we are looking for, in this case fstab.

4. run the following commands and explain the output df, du-h

  • df reports information about each disk’s file system.
  • du reports the disk usage of each file or directory in the current directory.
  • running df gives the following output:

df

  • running du -h gives the following output:

du

5. run the following command and explain the output lspci –nn

  • lspci displays information about each PCI bus on your system. This includes information about the devices connected to the PCI subsystem.
  • the flag -nn is used to display the PCI device ID and vendor ID in numeric format.

lspci