0
0
Linux CLIscripting~10 mins

df (disk free space) 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 show disk free space in human-readable format.

Linux CLI
df [1]
Drag options to blanks, or click blank then click option'
A-h
B-a
C-l
D-t
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-a' which shows all filesystems but not human-readable sizes.
Using '-l' which limits output to local filesystems.
Using '-t' which filters by filesystem type.
2fill in blank
medium

Complete the command to display disk free space for the root directory only.

Linux CLI
df [1] /
Drag options to blanks, or click blank then click option'
A-h
B-T
C-i
D-x
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-T' which shows filesystem type but not human-readable sizes.
Using '-i' which shows inode information instead of disk space.
Using '-x' which excludes filesystem types.
3fill in blank
hard

Fix the error in the command to show disk free space with filesystem type included.

Linux CLI
df [1]
Drag options to blanks, or click blank then click option'
A-t
B-hT
C-T
D-i
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-hT' which shows both human-readable sizes and filesystem type.
Using '-t' which filters by filesystem type instead of showing it.
Using '-i' which shows inode info, not filesystem type.
4fill in blank
hard

Fill the blanks to show disk free space excluding temporary filesystems and in human-readable format.

Linux CLI
df [1] [2] [3]
Drag options to blanks, or click blank then click option'
A-h
B-x
Ctmpfs
D-T
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-T' which shows filesystem type but does not exclude anything.
Using 'tmpfs' as an option instead of a value for '-x'.
5fill in blank
hard

Fill all three blanks to create a dictionary of mount points and their used space in human-readable form.

Linux CLI
df -h | awk '{{print $[1], $[2]' | while read [3] used; do echo "$used on $[3]"; done
Drag options to blanks, or click blank then click option'
A6
B3
Cmount
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up column numbers for mount point and used space.
Using wrong variable names in the while loop.