Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the command to check the Ubuntu version installed on your system.
Linux CLI
lsb_release [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-v' which shows only the short release version, not full distribution info.
Using '-h' which shows help instead of version info.
✗ Incorrect
The 'lsb_release -a' command shows detailed information about the Linux distribution, including the Ubuntu version.
2fill in blank
mediumComplete the command to list all installed packages on a CentOS system using yum.
Linux CLI
yum [1] installed Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'show' or 'info' which do not list installed packages.
Using 'search' which looks for packages but does not list installed ones.
✗ Incorrect
The 'yum list installed' command lists all packages installed on a CentOS system.
3fill in blank
hardFix the error in the Fedora command to update all packages.
Linux CLI
dnf [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'update' instead of 'upgrade'.
Using 'install' or 'remove' which do not upgrade packages.
✗ Incorrect
The correct command to update all packages in Fedora is 'dnf upgrade'.
4fill in blank
hardFill both blanks to create a command that shows the Fedora release version.
Linux CLI
cat /etc/[1]-release | grep [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'centos' instead of 'fedora' in the file name.
Using 'RELEASE' in grep which may not filter the version line.
✗ Incorrect
The file '/etc/fedora-release' contains Fedora version info. Using grep 'VERSION' filters the version line.
5fill in blank
hardFill all three blanks to create a dictionary comprehension that maps distribution names to their version files if the file exists.
Linux CLI
versions = {dist: f'/etc/[1]-release' for dist in ['ubuntu', 'centos', 'fedora'] if os.path.exists(f'/etc/[2]-release') and dist [3] 'fedora'} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' instead of '!=' which includes 'fedora' instead of excluding it.
Using a fixed string instead of 'dist' in file paths.
✗ Incorrect
The comprehension uses 'dist' to build file paths and filters out 'fedora' with '!=' operator.