Here we bring you some of the basic Linux questions and answers recommended for freshers. These questions will cover various aspects of the Linux operating system. Being a professional, you must know the basics of Linux so that you stand out in a competitive world.
In this tutorial, we have presented basic Linux questions focusing on some real-time user scenarios. By going through these questions, you’ll learn 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.
Q:1-8 Basic Linux Questions
Please note that the answer keys are available at the end of this tutorial. You can find it at the bottom of page 4 of the basic Linux questions.
Q-1. Which command can 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
Q-2. Which command returns the first byte of the difference observed in two files?
A. diff
B. cmp
C. comm
D. ls -a
Q-3. Which command opens a file 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
Q-4. Which command can talk to logged-in users?
A. talk
B. write
C. chat
D. transmit
Q-5. Which command sets the screen back to normal?
A. tput cup
B. tput smso
C. tput rmso
D. tput blink
Q-6. Which command can be used to view all the available routes?
A. show route
B. netstat -r
C. none of the above
D. route status
Q-7. Which command reduces the size of a file?
A. file
B. filefrag
C. zipnote
D. gzip
Q-8. Which command imposes limits on the file size?
A. fsize
B. flimit
C. ulimit
D. usize
So far, you have checked out 8 basic Linux questions. In order to access the remaining questions, please click the next button.
Also Read: 30 Linux Questions for Interview
Q:9-17 Basic Linux Questions
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
Q-10. Which structure on the disk stores the attributes related to a file?
A. inode
B. Data block
C. Block in a file
D. Directory
Q-11. How many links can be created for a new directory?
A. 1
B. 2
C. 3
D. 4
Q-12. Which statement will stand false for the command <ln file1 file2>?
A. Both files have the same inode number.
B. The number of links for file 1 is 1.
C. The number of links for file 1 is 2.
D. The number of links for file 2 is 2.
Q-13. What happens if we delete a file carrying two hard links?
A. Can access the file with hl and h2 but not with sl.
B. Can access the file with hl and h2 but with sl.
C. Can access the file with any of hl, h2, or sl.
D. Can access the file with any of hl, h2, and sl.
Q-14. Which structure has two files pointing to it?
A. Soft links
B. Hard links
C. Alias
D. Special files
Q-15. Which statement is true for the creation of hard links?
A. Allowed only to the root user.
B. Can be done by all users.
C. The effects are unspecified.
D. Not allowed.
Q-16. Where are the printer devices rest in a Linux file system?
A. /etc
B. /dev
C. /lib
D. /printer
So far, you have checked out 16 basic Linux questions. In order to access the remaining questions, please click the next button.
Also Read: Linux Commands Cheat Sheet
Q:17-24 Basic Linux Questions
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
Q-18. Which of the following statements holds true for the ln command?
A. Creates a file pointing to an existing file.
B. Creates a file as a copy of an existing file.
C. Moves the file from one location to another.
D. Used to rename a file.
Q-19. Which of the following statements holds true for file permission 764?
A. All – Read | Group – Execute | Owner – Read and Write
B. All – Read and Write | Owner – Execute.
C. All – Read | Group & Owner – Write | Owner – Execute.
D. All – Read, Write, and Execute.
Q-20. Which of the following correctly represents the permission for the given octal expression?
-rwxr–r–
A. 777
B. 666
C. 744
D. 711
Q-21. Which of the following permissions can be used to set the effective group ID?
A. 0777
B. 2666
C. 4744
D. 1711
Q-22. Which of the following permissions can be used to set the Sticky bit?
A. 0777
B. 2666
C. 4744
D. 1711
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
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–
So far, you have checked out 24 basic Linux questions. In order to access the remaining questions, please click the next button.
Try This: 7 Programmer Friendly Linux Commands
Q:25-32 Basic Linux Questions
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
Q-26. Which of the following statements holds true for the command given below?
$ chmod o-w testfile
A. Set Write Permission for All
B. Set Write Permission for Others
C. Clear Write Permission for All
D. Clear Write Permission for Others
Q-27. What does the following command accomplish?
$ chmod +x testfile.txt
A. Provide “execute” permissions to the user running the command.
B. Assign “execute” permissions to the owner of the file.
C. Set “execute” permissions for all the users (i.e. user, group, and others).
D. None
Q-28. Which of the following commands determines the usage of a file system in Linux?
A. mount
B. df
C. du
D. dd
Q-29. Which of the following enables fast file system recovery?
A. ext2
B. Journaling
C. Caching
D. sysfs
Q-30. Which file system allows kernel parameters to change at runtime using the “sysctl
” command?
A. ext3
B. sysfs
C. ext4
D. procfs
Q-31. Which of the following articulates the difference between the Linux and the Windows file system?
A. Linux detects a partition at boot-time and assigns a drive letter. But in Windows, you mount the partition first.
B. Windows detects a partition at boot time and assigns a drive letter. Whereas in Linux, you mount the partition first.
C. Windows detects a partition at reboot and obtains a drive letter. Whereas in Linux, you mount the partition first.
D. Windows detects a partition at reboot and assigns a drive letter. Whereas in Linux, you mount a partition first.
Q-32. Which of the following commands returns the current values of shell variables in a console session?
A. echo
B. env
C. val
D. export
Answer Key – Basic Linux Questions
(1) Answer. C (2) Answer. B
(3) Answer. A (4) Answer. A
(5) Answer. C (6) Answer. B
(7) Answer. D (8) Answer. C
(9) Answer. A (10) Answer. A
(11) Answer. B (12) Answer. B
(13) Answer. A (14) Answer. B
(15) Answer. D (16) Answer. B
(17) Answer. D (18) Answer. A
(19) Answer. A (20) Answer. C
(21) Answer. A (22) Answer. D
(23) Answer. B (24) Answer. D
(25) Answer. C (26) Answer. D
(27) Answer. C (28) Answer. B
(29) Answer. B (30) Answer. D
(31) Answer. B (32) Answer. B
Summary – Basic Linux Questions and Answers for Freshers
We are hopeful that the above basic Linux questions and answers will 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 enjoyed the post, then please care to share it with friends and on social media.
All the Best,
TechBeamers