Menu

Practice questions: Text, output and the console

Pick an answer and press "Check answer" to see right away whether you got it. If you are unsure, open "Read the article" to review the command and then try again. Questions you answer correctly are remembered in this browser.

20 questions Solved 0 / 20

CERTUTIL - Hash Values & Base64

Read the article →

CERTUTIL - Hash Values & Base64 — Question 1

Which command correctly calculates the SHA-256 hash of the file setup.exe?

Choose one answer.

  1. certutil -hashfile setup.exe SHA256
  2. certutil -hashfile setup.exe
  3. certutil -encode setup.exe SHA256

chcp - Switch the Character Encoding

Read the article →

chcp - Switch the Character Encoding — Question 1

Which command switches Command Prompt to UTF-8?

Choose one answer.

  1. chcp 932
  2. chcp 65001
  3. chcp 437

chcp - Switch the Character Encoding — Question 2

Which statement about running chcp 65001 is correct?

Choose one answer.

  1. It only applies to the Command Prompt window that is currently open
  2. It permanently changes the default encoding of all of Windows
  3. All batch files are saved as UTF-8 from then on

CLIP - Copy to Clipboard

Read the article →

CLIP - Copy to Clipboard — Question 1

Which command correctly copies the contents of memo.txt to the clipboard?

Choose one answer.

  1. clip < memo.txt
  2. clip > memo.txt
  3. copy memo.txt clip

color / title - Colors and Window Title

Read the article →

color / title - Colors and Window Title — Question 1

Which command gives a blue background with bright white text?

Choose one answer.

  1. color F1
  2. color 1F
  3. color 11

color / title - Colors and Window Title — Question 2

How do you restore the colors changed with color to the ones in effect when Command Prompt started?

Choose one answer.

  1. color 07
  2. color (run without arguments)
  3. title

DOSKEY - Macros and Aliases

Read the article →

DOSKEY - Macros and Aliases — Question 1

Which is the correct way to list the macros registered with DOSKEY?

Choose one answer.

  1. Run doskey /macros
  2. Run doskey /list
  3. Run doskey /alias

DOSKEY - Macros and Aliases — Question 2

What does $* mean in a DOSKEY macro definition?

Choose one answer.

  1. All arguments typed after the macro name
  2. A command separator (chains multiple commands)
  3. A replacement for the redirection symbol >

echo - Display Text

Read the article →

echo - Display Text — Question 1

Which command is the safe way to display a blank line?

Choose one answer.

  1. echo
  2. echo.
  3. echo off

echo - Display Text — Question 2

Which line, placed at the top of a batch file, also hides the echo off line itself?

Choose one answer.

  1. @echo off
  2. echo @off
  3. off @echo

FC - Compare Files

Read the article →

FC - Compare Files — Question 1

Which command compares two text files and shows the line numbers of the differing lines?

Choose one answer.

  1. fc /B a.txt b.txt
  2. fc /N a.txt b.txt
  3. fc /C a.txt b.txt

FC - Compare Files — Question 2

What exit code does FC return when the two files are exactly identical?

Choose one answer.

  1. 0
  2. 1
  3. 2

findstr - Advanced Text Search

Read the article →

findstr - Advanced Text Search — Question 1

What happens when you run findstr "disk full" log.txt without the /C: option?

Choose one answer.

  1. Lines containing "disk" and lines containing "full" are both shown (OR search)
  2. Only lines containing the string "disk full" are shown
  3. An error occurs and the search fails

MODE - Window Size and Key Repeat

Read the article →

MODE - Window Size and Key Repeat — Question 1

Which command sets the Command Prompt window to 100 columns wide and 30 lines high?

Choose one answer.

  1. mode con: width=100 height=30
  2. mode con: cols=100 lines=30
  3. mode size 100 30

MODE - Window Size and Key Repeat — Question 2

Which statement is correct about changing the key repeat settings with mode con?

Choose one answer.

  1. Specifying only RATE is enough
  2. Specifying only DELAY is enough
  3. You must specify both RATE and DELAY at the same time

prompt - Customize the Command Prompt

Read the article →

prompt - Customize the Command Prompt — Question 1

Which special code displays the current time in the prompt?

Choose one answer.

  1. $D
  2. $T
  3. $V

prompt - Customize the Command Prompt — Question 2

How do you restore a prompt changed with the prompt command to its default?

Choose one answer.

  1. prompt reset
  2. Run prompt with no argument
  3. Run cls

SORT - Sort Lines of Text

Read the article →

SORT - Sort Lines of Text — Question 1

Which command displays the lines of data.txt in descending order?

Choose one answer.

  1. sort /R data.txt
  2. sort /D data.txt
  3. sort -r data.txt

SORT - Sort Lines of Text — Question 2

A file contains 10, 2, 33, and 1, one per line. What is the result of running sort on it without options?

Choose one answer.

  1. 1, 2, 10, 33
  2. 1, 10, 2, 33
  3. 33, 10, 2, 1

SORT - Sort Lines of Text — Question 3

What happens when you run sort fruits.txt > fruits.txt?

Choose one answer.

  1. The original file is overwritten with the sorted content
  2. The original file becomes empty and its contents are lost
  3. The original file is unchanged and the result is shown on screen

Other topics

← Back to all practice questions