Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the command to view the contents of a file named 'example.txt' one page at a time using the 'less' command.
Linux CLI
less [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using options like '-r' or '-n' without specifying the file.
Typing only 'less' without a file name.
✗ Incorrect
The 'less' command followed by the filename 'example.txt' opens the file for paginated viewing.
2fill in blank
mediumComplete the command to view the output of 'dmesg' command one page at a time using 'more'.
Linux CLI
dmesg | [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'cat' which outputs all at once.
Using 'head' which shows only the first few lines.
✗ Incorrect
The pipe '|' sends the output of 'dmesg' to 'more' for paginated viewing.
3fill in blank
hardFix the error in the command to view a file named 'log.txt' with 'less' and show line numbers.
Linux CLI
less [1] log.txt Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-n' which disables line numbers in 'less'.
Using '-l' or '-h' which are unrelated options.
✗ Incorrect
The '-N' option with 'less' shows line numbers while viewing the file.
4fill in blank
hardFill both blanks to create a command that shows the first 20 lines of 'data.txt' and then views it page by page.
Linux CLI
head [1] [2] data.txt | less
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-20' instead of '-n 20' which is less clear.
Swapping the order of options and filename.
✗ Incorrect
The 'head -n 20 data.txt' command shows the first 20 lines of the file, piped into 'less' for paginated viewing.
5fill in blank
hardFill all three blanks to create a command that searches for the word 'error' in 'system.log', ignoring case, and views the results page by page.
Linux CLI
grep [1] [2] [3] | less
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-v' which inverts the match.
Swapping the order of search word and filename.
✗ Incorrect
The command 'grep -i error system.log | less' searches case-insensitively for 'error' in 'system.log' and pipes the output to 'less' for paginated viewing.