Unix/Linux Commands and Shell Scripting

Test your knowledge of essential Unix/Linux operating system commands, shell scripting operators, process management, and file operations.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

How can you append the output of a command to a file?

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

Using which command you can see your user name?

  1. whoami
  2. pwd
  3. who
  4. uname
Question 3 Multiple Choice (Single Answer)

How can you display list of all files, including the hidden files?

  1. find -a
  2. ls -a
  3. find all
  4. ls -l
Question 4 Multiple Choice (Single Answer)

How to create a new file, without opening it?

  1. touch filename
  2. cat filename
  3. less filename
  4. create filename
Question 5 Multiple Choice (Single Answer)

Using which command you can stop a process?

  1. stop
  2. kill
  3. delete
  4. sleep
Question 6 Multiple Choice (Single Answer)

How do you get all files, which having 3rd place as r, g or i?

  1. ls [rgi]
  2. ls ?3[rgi]*
  3. ls ??[rgi]*
  4. ls **[rgi]?
Question 7 Multiple Choice (Single Answer)

Which command is used to modify the access time of a file?

  1. chmod
  2. touch
  3. chown
  4. mtime
Question 8 Multiple Choice (Single Answer)

vim editor uses which hidden file for configuration settings

  1. .bashrc
  2. .exrc
  3. .usrc
  4. .vimrc
Question 9 Multiple Choice (Single Answer)

How do we configure the vim editor to automatically add numbers to the file when it opens?

  1. se nu
  2. se nonu
  3. se n
  4. se history
Question 10 Multiple Choice (Single Answer)

What command used to Look at a file, one page at a time

  1. cat
  2. more
  3. less
  4. view
Question 11 Multiple Choice (Single Answer)

Which command is used to display all the files?

  1. ls
  2. cat
  3. ls -a
  4. type
  5. dir
Question 12 Multiple Choice (Single Answer)

Which command is used to modify the access time of a file?

  1. chmod
  2. chown
  3. touch
  4. cd
  5. grep
Question 13 Multiple Choice (Single Answer)

vim editor uses which hidden file for configuration settings?

  1. .bashrc
  2. .exrc
  3. .etcrc
  4. .vimrc
  5. .usrc
Question 14 Multiple Choice (Single Answer)

How do we configure vim editor to automatically add numbers to the file when it opens?

  1. se nu
  2. se bs
  3. se history
  4. se noai
  5. se nonu
Question 15 Multiple Choice (Single Answer)

Which command is used to view the file without modifying it?

  1. view
  2. cat
  3. more
  4. head
  5. tail
Question 16 Multiple Choice (Single Answer)

How do you find out what's your shell?

  1. echo $shell
  2. ls $shell
  3. view $shell
  4. cat $shell
  5. show $shell
Question 17 Multiple Choice (Single Answer)

How do you stop a process?

  1. kill pid
  2. stop pid
  3. abort pid
  4. exit pid
  5. None of the above
Question 18 Multiple Choice (Single Answer)

Which of these is a number comparison operator in shell scripts?

  1. -eq
  2. -ne
  3. -lt
  4. All of the above
  5. None of the above
Question 19 Multiple Choice (Single Answer)

Which of these is a Boolean logic operators in shell scritping?

  1. - !
  2. - a
  3. - o
  4. All of the above
  5. None of the above
Question 20 Multiple Choice (Single Answer)

You need to see the last fifteen lines of a file. What command should you use?

  1. tail -15 filename
  2. head -15 filename
  3. zcat -15 filename
  4. All of the above
  5. None of the above