nerdexam
CompTIA

220-1002 · Question #202

A technician logs on to a Linux computer and runs the following command: ps -aux | grep vi Which of the following MOST accurately describes the effect of the command?

The correct answer is D. If finds a list of processes running a text editor. The command has two parts joined by a pipe (|). 'ps -aux' lists all running processes on the system for all users. The output is piped to 'grep vi', which filters that list to show only lines containing the string 'vi'. Since 'vi' is a well-known Linux text editor, this command…

Hardware and network troubleshooting

Question

A technician logs on to a Linux computer and runs the following command:

ps -aux | grep vi Which of the following MOST accurately describes the effect of the command?

Options

  • AIt kills any running programs starting with the letters vi.
  • BIt opens a list of directories that start with the letters vi.
  • CIt creates a new file named grep in the current working directory.
  • DIf finds a list of processes running a text editor.

How the community answered

(34 responses)
  • A
    6% (2)
  • C
    3% (1)
  • D
    91% (31)

Explanation

The command has two parts joined by a pipe (|). 'ps -aux' lists all running processes on the system for all users. The output is piped to 'grep vi', which filters that list to show only lines containing the string 'vi'. Since 'vi' is a well-known Linux text editor, this command effectively finds any currently running instances of the vi (or vim) text editor - making D the correct answer. It does not kill processes (A) - that would require 'kill' or 'pkill'. It does not list directories (B) - that would use 'ls' or 'find'. It does not create a file named grep (C) - the pipe sends output between commands, not to a file.

Topics

#Linux commands#ps command#process management#grep

Community Discussion

No community discussion yet for this question.

Full 220-1002 Practice