Linux Certified Professional (LCP) Powered by LPI v5.0

Page:    1 / 20   
Exam contains 289 questions

You wish to execute two commands, one after the other. However, you only want the second command to execute if the first is successful. Which character(s) do you put between the commands on the command line to accomplish this?



Answer : &&

In the vi editor, which of the following commands will delete the current line at the cursor and the 16 lines following it (17 lines total)?

  • A. 17d
  • B. 17dd
  • C. 17x
  • D. d17d
  • E. 16d


Answer : B

You wish to send the output of a command to standard output (stdout) and save it to a file.
The command to use is ______________. (Do not specify arguments)



Answer : tee 37 As root you have navigated to directory /B. You wish to move all of the files and directories from directory /A to directory /B. Which of the following options would be the most appropriate command line to execute this task? cp /a/* . mv -f /A/* . mv -Rf /a/* . cp -f /a/* .. cp -rf /A/* /b/ B

What key sequence will suspend the current process and return you to a shell prompt?

  • A. Ctrl-z
  • B. Ctrl-c
  • C. Ctrl-x
  • D. Ctrl-d


Answer : A

Which TWO commands will find the path for the binary vim?

  • A. man vim
  • B. whereis vim
  • C. apropos vim
  • D. which vim


Answer : B,D

Explanation:
which and whereis command displays the executable path of commands. Example: which clearShows actually where clear is stored similarly whereis clear.

What command returns the first few lines of a given file?



Answer : head

What command changes the priority of the process running with process id of 12345 to the highest priority?

  • A. /usr/bin/renice +20 1234
  • B. /usr/bin/renice -20 12345
  • C. /bin/setpriority +20 12345
  • D. /bin/setpriority -20 12345


Answer : B

Explanation:
To change the priority of running process we use the renice command. Default priority is 0, highest priority is -20 and lowest priority is 19. The path of renice command is
/usr/bin/renice.

You want to save vi changes to the file myfile with :w!, but vi complains it can not write to the file. Therefore, you want to check the write permissions on the file. To do this without leaving vi, you type:

  • A. :!ls -l myfile
  • B. :\ls -l myfile
  • C. esc :ls -l myfile
  • D. :?ls -l myfile


Answer : A

Which of the following GNU commands would be the most likely command you'd use to find the system load average?

  • A. top
  • B. nice
  • C. loadavg
  • D. cpustat
  • E. ps


Answer : A

Explanation:
The top program provides a dynamic real-time view of a running system. It can display system summary information as well as a list of tasks currently being managed by the
Linux kernel. The types of system summary information shown and the types, order and size of information displayed for tasks are all user configurable and that configuration can be made persistent across restarts.

Which of the following commands is equivalent to kill 1234?

  • A. kill -1 1234 or kill -s SIGHUP 1234
  • B. kill -2 1234 or kill -s SIGINT 1234
  • C. kill -3 1234 or kill -s SIGQUIT 1234
  • D. kill -9 1234 or kill -s SIGKILL 1234
  • E. kill -15 1234 or kill -s SIGTERM 1234


Answer : E

What command would execute cmd1 followed by cmd2, regardless of the exit status of cmd1?

  • A. cmd1 cmd2
  • B. cmd1 | cmd2
  • C. cmd1 ; cmd2
  • D. cmd1 && cmd2
  • E. cmd1 || cmd2


Answer : C

You have a text file with tab-separated values, but your application needs them space- separated. What command would you use from the Bash shell to achieve this? Please fill in the command only, without any options.



Answer : expand

Which command will print to standard out only the lines that do not begin with # (pound symbol) in the file foobar?

  • A. /bin/grep ^# foobar
  • B. /bin/grep -v ^# foobar
  • C. /bin/grep #$ foobar
  • D. /bin/grep -v #$ foobar


Answer : B

What command will remove duplicate lines from a sorted file?

  • A. filter
  • B. trim
  • C. uniq
  • D. wc


Answer : C

Explanation:
uniq - remove duplicate lines from a sorted file

Which command line option would you use to restrict the GNU find command to searching a particular number of subdirectories?

  • A. --max-dirs
  • B. -dirmax
  • C. -maxdepth
  • D. -s
  • E. -n


Answer : C

Page:    1 / 20   
Exam contains 289 questions

Talk to us!


Have any questions or issues ? Please dont hesitate to contact us