Unix/Linux Commands and Operating Systems Basics

Test your knowledge of Unix/Linux command-line operations, shell scripting basics, and fundamental operating systems concepts including file permissions, process states, and I/O operations.

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

_____________ is the command that writes the last 10 lines of a file to the screen.

  1. head
  2. last
  3. tail
  4. cat
Question 2 Multiple Choice (Single Answer)

Which command is used to change your password?

  1. pwd
  2. Passwd
  3. password
  4. user
Question 3 Multiple Choice (Single Answer)

Which command will display a calendar?

  1. ls
  2. cat
  3. grep
  4. cal
Question 4 Multiple Choice (Single Answer)

Which command can be used to display the contents of a file on the screen?

  1. dir
  2. cp
  3. cal
  4. cat
Question 5 Multiple Choice (Single Answer)

Which command would you use to create a sub-directory in your home directory?

  1. dir
  2. rmdir
  3. cd
  4. mkdir
Question 6 Multiple Choice (Single Answer)

_____________ is the command that writes the first 10 lines of a file to the screen.

  1. whereami
  2. head
  3. dir
  4. ls
Question 7 Multiple Choice (Single Answer)

The ________ command will display the absolute pathname for the directory that you are wokring in.

  1. pwd
  2. cwd
  3. dir
  4. ls
Question 8 True/False

wc command will report mispelled words.

  1. True
  2. False
Question 9 Multiple Choice (Single Answer)

Which command allows you to determine if a host is connected to the Internet?

  1. ls
  2. dir
  3. ping
  4. host
Question 10 Multiple Choice (Single Answer)

The file assign4.html has permissions set as rwxrwxrwx

  1. The file is really a directory and was named incorrectly.
  2. It is impossible for an html file to have permissions set that way.
  3. Everyone can read, write, and execute the file.
  4. The file can not be viewed on the WWW.
Question 11 Multiple Choice (Single Answer)

When a thread blocks on I/O, which of the following are true?

  1. The thread enters the ready state
  2. The thread enters the dead state
  3. No other thread may perform I/O
  4. The thread enters the waiting state
Question 12 Multiple Choice (Single Answer)

What is the command used for redirecting the standard error (stderr) to a file?

  1. <
  2. >>
  3. 2>
  4. <2
Question 13 Multiple Choice (Single Answer)

What is the result of doing the following? date >> file

  1. The date output is redirected to the file.
  2. The date output is redirected and appended to the end of the file.
  3. The date output is redirected and appended to the beginning of the file.
  4. None of the above
Question 14 Multiple Choice (Single Answer)

Which of the following will return the exit code of the last executed command?

  1. $%
  2. $#
  3. $?
  4. $!
Question 15 Multiple Choice (Single Answer)

What is the command used for changing the scope of a shell variable to a global variable?

  1. global
  2. shell
  3. export
  4. None of the above