MODULE 10- Working with text Flashcards
Which type of files make up a large portion of a typical Linux file system and contain only unformatted text?
→ Text files, which include only raw text without formatting like that found in word processing documents.
Which command is not ideal for viewing large files because it dumps the entire content without a way to pause or resume?
→ The cat command, which displays everything at once with no built-in paging control.
Which command, short for “concatenate,” is used for creating, viewing, and combining text files?
→ The cat command, which can display, create, or concatenate the contents of text files.
Which shell feature allows users to send the output of commands to files or other commands instead of just displaying it in the terminal?
Output redirection
Which command is more advanced and is typically the default pager for tools like the man command?
→ The less command, which offers advanced paging capabilities and is often set as the default pager.
Which command, though older and less feature-rich, is always available on Linux systems when less is not?
→ The more command, a legacy pager present since the early days of UNIX.
Which command, despite being less capable, is guaranteed to exist on all Linux distributions?
→ The more command, known for its universal availability.
Which command is used to display the help screen while viewing a file with less?
→ The H key or Shift+H, which opens a help screen listing available movement commands.
Which key should you press to advance forward one window while using the less pager?
→ The Spacebar, which moves the view one full page forward.
Which key do you press after typing a search pattern to initiate the search?
→ The Enter key, which executes the search after entering a pattern with / or ?.
Which key combination moves the view backward by one window in both more and less?
→ The B key, which scrolls the content backward by one screenful.
Which key moves the cursor forward by a single line in both more and less?
→ The Enter key, which advances the view one line at a time.
Which key exits the pager interface in both the more and less commands?
→ The Q key, which quits the viewing session and returns to the shell.
Which type of expressions are used for matching text patterns in less searches?
→ Regular expressions, which define flexible matching rules for search queries.
Which key starts a backward search from your current position when using the less command?
→ The ? key, used to search in the reverse direction through the document.
Which key do you press in less to begin a forward search from your current position?
Which key do you press in less to begin a forward search from your current position?
Which key moves the cursor to the next matching result after a search in less?
→ The n key, which jumps to the next match in the current search direction.
Which key combination moves the cursor to the previous match during a search in less?
→ The Shift+N key, which reverses search direction and shows earlier matches.
Which command displays the first few lines of a file, defaulting to 10 lines?
→ The head command, used to view the beginning of a file or output.
Which command would you use to see the first 10 lines of /etc/sysctl.conf?
→ head /etc/sysctl.conf, which shows the default number of lines (10).
Which command shows the last few lines of a file, displaying 10 lines by default?
→ The tail command, which outputs the ending lines of a file or command result.
Which command would you use to see only the last 5 lines of /etc/sysctl.conf?
→ tail -5 /etc/sysctl.conf, using the numeric short option format.
Which option allows you to explicitly specify the number of lines to output in head or tail?
→ The -n option, followed by the number of lines.
Which command would output the first 3 lines of a file?
→ head -n 3 filename, using the long-form numeric option.