0
0
Linux CLIscripting~10 mins

Linux distributions overview (Ubuntu, CentOS, Fedora) in Linux CLI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
A-a
B-l
C-v
D-h
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.
2fill in blank
medium

Complete 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'
Asearch
Bshow
Cinfo
Dlist
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.
3fill in blank
hard

Fix the error in the Fedora command to update all packages.

Linux CLI
dnf [1]
Drag options to blanks, or click blank then click option'
Ainstall
Bupgrade
Cupdate
Dremove
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'update' instead of 'upgrade'.
Using 'install' or 'remove' which do not upgrade packages.
4fill in blank
hard

Fill 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'
Afedora
BVERSION
CRELEASE
Dcentos
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.
5fill in blank
hard

Fill 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'
Adist
C!=
D==
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.