Linux/Unix Command Line Quiz

Test your knowledge of Linux/Unix command-line operations including file management, directory navigation, permissions, system files, and the vi editor.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

What does the pwd command do?

  1. It changes the password of user
  2. It shows the current path where the user is
  3. It shows the passwd file
  4. It shows information about Linux architecture
Question 2 Multiple Choice (Single Answer)

What is the use of touch command?

  1. It makes a new empty file
  2. It displays the contents of a file
  3. It updates the pre existing file
  4. It makes a new directory
Question 3 Multiple Choice (Single Answer)

The user's current path is /root/Desktop/abc. If he runs $ cd ../../../ what will be the user's HIS current path?

  1. /
  2. /root/
  3. /root/Desktop
  4. /root/Desktop/abc
Question 4 Multiple Choice (Single Answer)

From where can the passwd file be accessed?

  1. /usr/bin
  2. /etc/passwd
  3. /sbin/passwd
  4. /root/Desktop
Question 5 Multiple Choice (Single Answer)

What is the correct syntax of 'find the passwd file'?

  1. Find-name /etc
  2. Find/-name passwd
  3. Find -uid root -gid root -name passwd
  4. Find passwd
Question 6 Multiple Choice (Single Answer)

If umask is 0022, what is the by default permission of a file?

  1. 644
  2. 655
  3. 666
  4. 777
Question 7 Multiple Choice (Single Answer)

What is the name of the file where groups are added?

  1. /etc/grp
  2. /etc/groups
  3. /etc/group
  4. /usr/bin/group
Question 8 Multiple Choice (Single Answer)

What is the correct format to open the file /etc/test into the vi editor?

  1. /etc/test vi
  2. vi /etc/test
  3. edit /etc/test
  4. None of these
Question 9 Multiple Choice (Single Answer)

Which of the following options delete a current line in vi editor?

  1. Del
  2. Dd
  3. DD
  4. Delete
Question 10 Multiple Choice (Single Answer)

Which of the following syntax creates a softlink?

  1. $ ln -s /etc/test test
  2. $ ln -softlink /etc/test test
  3. $ ln /etc/test test
  4. $ ln -slink /etc/test test
Question 11 Multiple Choice (Single Answer)

What does the head command do?

  1. It shows the first 20 lines
  2. It shows the first 10 lines
  3. It shows the first 50 lines
  4. It shows the first 5 lines
Question 12 Multiple Choice (Single Answer)

Command for custom oriented output on PS command is?

  1. ps -o
  2. ps -l
  3. ps -c
  4. ps -u
Question 13 Multiple Choice (Single Answer)

Command for creating and displaying short files?

  1. cat
  2. chmod
  3. cd
  4. cp
Question 14 Multiple Choice (Single Answer)

Command for Changing permision.

  1. cat
  2. chmod
  3. cd
  4. cp
Question 15 Multiple Choice (Single Answer)

Command for changing directory?

  1. mv
  2. cp
  3. more
  4. cd
Question 16 Multiple Choice (Single Answer)

Command for copying files?

  1. ls
  2. cd
  3. mv
  4. cp
Question 17 Multiple Choice (Single Answer)

Command for display date?

  1. echo
  2. date
  3. head
  4. grep
Question 18 Multiple Choice (Single Answer)

Command to connect to a remote machine to download or upload files?

  1. ftp
  2. print
  3. more
  4. wc
Question 19 Multiple Choice (Single Answer)

Command for display first part of file?

  1. tail
  2. tar
  3. head
  4. telnet
Question 20 Multiple Choice (Single Answer)

Command to create a new directory.?

  1. mode
  2. lh
  3. md
  4. more