Basic Linux Questions and Answers – Online Test for Freshers

Here we bring you some of the basic Linux questions and answers recommended for freshers. These questions will cover various aspects of Linux operating system. Being a professional, you must know the basics of Linux so that you stand out in a competitive world.

Also, the opportunities for Linux jobs are increasing day by day. So, It is absolutely imperative to start preparing for Linux interviews. And there is no better way to learn than by attempting the online quizzes and practice tests.

In this article, we have presented basic Linux questions focusing on some real-time user scenarios. By going through these questions, you’ll know about the important Linux commands and get a sense of the patterns asked during Linux interviews.

If you want to try a Linux quiz right now to assess yourself, then you can pick any of the posts given below.

Basic Linux Questions and Answers – Online Test for Freshers.

Basic Linux Questions and Answers - Online Test for Freshers

Linux Online Test for Freshers.

Q-1. Which of the following commands can be used to append a file to the <mytest.tar> file?

A. No, you can’t add a file to <mytest.tar>.
B. tar -cvf mytest.tar file
C. tar -rvf file mytest.tar
D. tar -evf file mytest.tar

Click to see the answer.
Answer. C

 

Q-2. Which command returns the first byte of the difference observed in two files (say file1 and file2)?

A. diff
B. cmp
C. comm
D. ls -a

Click to see the answer.
Answer. B

 

Q-3. What is the command to open a file (say file1) with the cursor positioned at line num=5?

A. vi +num file1
B. vi +set num file1
C. vi +”set num” file1
D. vi +/set num file1

Click to see the answer.
Answer. A

 

Q-4. What is the command used for communicating with other logged-in users by writing to the bottom of their terminal?

A. talk
B. write
C. chat
D. transmit

Click to see the answer.
Answer. A

 

Q-5. Which of the following screen manipulation commands sets the screen back to normal?

A. tput cup
B. tput smso
C. tput rmso
D. tput blink

Click to see the answer.
Answer. C

 

Q-6. Which of the following commands can be used to view all the available routes?

A. show route
B. netstat -r
C. none of the above
D. route status

Click to see the answer.
Answer. B

 

Q-7. Which of the following commands cause to reduce the size of a file?

A. file
B. filefrag
C. zipnote
D. gzip

Click to see the answer.
Answer. D

 

Q-8. Which of the following commands imposes limits on the file size?

A. fsize
B. flimit
C. ulimit
D. usize

Click to see the answer.
Answer. C

 

Q-9. Which of the following commands is expected to rename a file from ABC to file XYZ?

A. mv ABC XYZ
B. move ABC XYZ
C. cp ABC XYZ
D. rm ABC XYZ

Click to see the answer.
Answer. A

 

Q-10. Which of the following structures on the disk stores the attributes related to a file?

A. inode
B. Data block
C. Block in a file
D. Directory

Click to see the answer.
Answer. A

 

Q-11. How many links can get created for a new directory?

A. 1
B. 2
C. 3
D. 4

Click to see the answer.
Answer. B

 

Q-12. Which of the following statements will stand false, if a user creates a link to a file using the command <ln file1 file2>?

A. Both the files have the same iNode number.
B. The number of links for file1 is 1.
C. The number of links for file1 is 2.
D. The number of links for file2 is 2.

Click to see the answer.
Answer. B

 

Q-13. What happens if we delete a file carrying two hard-links say h1 and h2 and one soft-link say sl?

A. We will be able to access the file with hl and h2 but not with sl.
B. We will not be able to access the file with hl and h2 but with sl.
C. We will be able to access the file with any of hl, h2 or sl.
D. We will not be able to access the file with any of hl, h2, and sl.

Click to see the answer.
Answer. A

 

Q-14. Which of the following inode structures have two files (belonging to the same partition) pointing to it?

A. Soft links
B. Hard links
C. Alias
D. Special files

Click to see the answer.
Answer. B

 

Q-15. Which of the following statements is true about the creation of hard links pointing across partitions?

A. Allowed only to root user.
B. Can be done by all users.
C. The effects are unspecified.
D. Not allowed.

Click to see the answer.
Answer. D

 

Q-16. Where are the printer devices rests in a Linux file system?

A. /etc
B. /dev
C. /lib
D. /printer

Click to see the answer.
Answer. B

 

Q-17. Which of the following commands is used to update the modification time of a file?

A. time
B. modify
C. cat
D. touch

Click to see the answer.
Answer. D

 

Q-18. Which of the following statements holds true for the ln command?

A. A file gets created pointing to an existing file.
B. A file gets created as a copy of an existing file.
C. Moves the file from one location to another.
D. Used to rename a file.

Click to see the answer.
Answer. A

 

Q-19. Which of the following statements holds true for the file permission 764?

A. All can read, the group can only execute, and the owner can perform both read and write operations.
B. All can read and write, and the owner can only execute.
C. All can read, the group including owner can write, and owner alone can execute.
D. All can read, write, and execute.

Click to see the answer.
Answer. A

 

Q-20. Which of the following correctly represents the permission for the given octal expression?

A. 777
B. 666
C. 744
D. 711

Click to see the answer.
Answer. C

 

Q-21. Which of the following permissions can be used to set the effective group id?

A. 0777
B. 2666
C. 4744
D. 1711

Click to see the answer.
Answer. B

 

Q-22. Which of the following permissions can be used to set the Sticky bit?

A. 0777
B. 2666
C. 4744
D. 1711

Click to see the answer.
Answer. D

 

Q-23. What will be the permissions of a new directory with the umask value as 0002?

A. 777
B. 775
C. 774
D. 664

Click to see the answer.
Answer. B

 

Q-24. What is the default permission assigned to a newly created file with a umask value of 112?

A. —x–x-wx
B. -rw-rw-r–
C. -r-xr-x-r–
D. -rw-rw-r–

Click to see the answer.
Answer. D

 

Q-25. What is the correct command for assigning the read-write permission to the owner?

A. chmod a+r file
B. chmod o+r file
C. chmod u=rw file
D. chmod og-r file

Click to see the answer.
Answer. C

 

Q-26. Which of the following statements holds true for the command given below?

A. Sets the write permission for everyone on the testfile.
B. Sets the write permission for others on the testfile. 
C. Clears the write permission for everyone on the testfile. 
D. Clears the write permission for others on the testfile.

Click to see the answer.
Answer. D

 

Q-27. What does the following command accomplish?

A. It’ll provide “execute” permissions to the user running the command. 

B. It’ll assign “execute” permissions to the owner of the file.
C. It’ll set “execute” permissions for all the users (i.e. user, group, and others).
D. None of the above.

Click to see the answer.
Answer. C

 

Q-28. Which of the following commands determines the usage of a file system in Linux?

A. mount
B. df
C. du
D. dd

Click to see the answer.
Answer. B

 

Q-29. Which of the following enables the fast file system recovery?

A. ext2
B. Journaling
C. Caching
D. sysfs

Click to see the answer.
Answer. B

 

Q-30. Which of the file systems allows changing the kernel parameters at runtime using the “sysctl” command?

A. ext3
B. sysfs
C. ext4
D. procfs

Click to see the answer.
Answer. D

 

Q-31. Which of the following articulates the difference between Linux file system and Windows file system?

A. Under Linux, the partitions get detected at boot-time and assigned a drive letter. But in Windows, unless you mount a partition or the device, the system doesn’t know of the existence of a partition or device.
B. Under Windows, the partitions get detected at boot-time and assigned a drive letter. Whereas in Linux, unless you mount a partition or a device, the system doesn’t know of their existence.
C. Under Windows, the partitions get recognized at reboot and obtains a drive letter. Whereas in Linux, unless you mount a partition or a device, the system doesn’t come to know of their existence.
D. Under Windows, the partitions are detected at reboot and assigned a drive letter. Whereas in Linux, you mount a partition or a device.

Click to see the answer.
Answer. B

 

Q-32. Which of the following commands returns the current values of shell variables in a console session?

A. echo command
B. env command
C. val command
D. export command

Click to see the answer.
Answer. B

 

Summary – Basic Linux Questions and Answers for Freshers.

We are hopeful that the above basic Linux questions and answers would help you immensely. And you’ll do well in your upcoming interviews.

It would be great if you let us know your feedback on this post.

Also, you can ask us to write on a topic of your choice. We’ll add it to our writing roadmap.

Lastly, if you’d enjoyed the post, then please care to share it with friends and on social media.

 

All the Best,

TechBeamers.

Leave a Reply


*