Welcome to the world of Linux! You might not realize it, but Linux is everywhere from the server rooms of big tech companies to the devices you use at home, like smartphones, smart TVs, and even some home appliances. It’s the backbone of a lot of technology we use every day.
If you’re new to Linux, don’t worry! This quiz is here to help you learn while having fun. Even if you’ve used Linux a little before, there’s always something new to explore.
Linux might seem tricky at first, especially the terminal (that black screen where you type commands), but once you get the hang of it, you’ll see how powerful and flexible it can be.
This quiz will test some basic commands and concepts, but don’t stress if you’re just starting out. This is a great opportunity to learn and grow your Linux skills in a fun and interactive way.
So, grab your coffee, get comfortable, and let’s jump in! Ready to see how well you really know Linux?
Question 1: What command is used to list the files and directories in the current working directory?
- A)
ls
- B)
pwd
- C)
cd
- D)
rm
ls
Explanation: The ls command lists the contents of a directory. You can even use flags like ls -l
for more detailed information!
Question 2: Which command shows your current directory path?
- A)
pwd
- B)
ls
- C)
cd
- D)
find
pwd
Explanation: The pwd stands for “print working directory” and tells you exactly where you are in the file system.
Question 3: What does the chmod command do in Linux?
- A) Changes file permissions
- B) Lists files
- C) Deletes files
- D) Changes file name
Explanation: The chmod
command is used to change the permissions of a file or directory. For example, chmod 755 filename
grants read, write, and execute permissions to the owner and read and execute permissions to others.
Question 4: To navigate between directories, which command would you use?
- A)
cd
- B)
mv
- C)
cp
- D)
rm
cd
Explanation: The cd (change directory) command lets you move between directories. For example, cd /home/user/Documents
takes you to the Documents directory.
Question 5: You need to find out how much disk space is available on your system. Which command would you use?
- A)
free
- B)
df
- C)
diskspace
- D)
top
df
Explanation: The df command reports the available disk space for each mounted file system. You can use df -h
to get a human-readable format.
Question 6: Which command is used to check the available memory in the system?
- A)
top
- B)
free
- C)
df
- D)
ps
free
Explanation: The free command shows the available, used, and free memory in your system. You can use free -h
for a more readable format.
Question 7: What command is used to copy files from one location to another?
- A)
cp
- B)
mv
- C)
rsync
- D)
rm
cp
Explanation: The cp command is used to copy files and directories. For example, cp file1.txt file2.txt
copies file1.txt
to file2.txt
.
Question 8: What does the top command do?
- A) Lists all files
- B) Shows the current directory
- C) Displays running processes
- D) Changes file permissions
Explanation: The top command shows real-time information about system processes, memory usage, and CPU usage.
Question 9: To move or rename files, which command would you use?
- A)
cp
- B)
mv
- C)
rm
- D)
ls
mv
Explanation: The mv command is used to move or rename files and directories. For example, mv oldname.txt newname.txt renames a file.
Question 10: Which command is used to remove a file in Linux?
- A)
rm
- B)
del
- C)
delete
- D)
remove
rm
Explanation: The rm command removes files or directories. Be careful when using rm
, as it deletes items permanently.
Question 11: Which command displays the current logged-in users?
- A)
whoami
- B)
who
- C)
users
- D)
id
who
Explanation: The who command displays a list of users currently logged into the system.
Question 12: Which command is used to display manual pages for a command?
- A)
help
- B)
man
- C)
info
- D)
doc
man
Explanation: The man command displays the manual (help) pages for various Linux commands. For example, man ls
shows the manual for the ls
command.
Question 13: Which command is used to search for a file by name?
- A)
search
- B)
find
- C)
locate
- D)
grep
find
Explanation: The find command helps you search for files by name or other criteria. For example, find /home/user/ -name "*.txt"
searches for all .txt
files in the /home/user/
directory.
Question 14: What does the sudo command do?
- A) Executes a command as the superuser or another user, based on the security policy
- B) Starts a new shell
- C) Copies files
- D) Changes the system settings
Explanation: The sudo command allows a permitted user to execute commands as the superuser or another user, provided they have the necessary privileges.
Question 15: How do you shut down a Linux system immediately?
- A)
reboot
- B)
shutdown -h now
- C)
poweroff
- D)
exit
shutdown -h now
Explanation: The shutdown -h now
command immediately powers off the system. Always make sure to save your work before shutting down!
Challenge Section:
Can you explain what happens when you run the command chmod 777 filename
?
Hint: It’s all about permissions! Share your answer in the comments below.
Answer Card
Ready to check your answers? Here’s the complete list:
Question | Correct Answer | Explanation |
---|---|---|
1 | A) ls |
Lists files and directories in the current location |
2 | A) pwd |
Prints the current working directory |
3 | A) | Changes file permissions using chmod |
4 | A) cd |
Used to change directories |
5 | B) df |
Displays available disk space |
6 | B) free |
Shows memory usage information |
7 | A) cp |
Copies files or directories |
8 | C) top |
Displays running processes with top |
9 | B) mv |
Moves or renames files |
10 | A) rm |
Deletes files or directories |
11 | B) who |
Lists currently logged-in users |
12 | B) man |
Opens the manual page for a command |
13 | B) find |
Searches for files and directories |
14 | A) sudo |
Executes commands as another user using sudo |
15 | B) shutdown -h now |
Shuts down the system immediately |
Your Results:
How did you do?
- 12-15 correct answers: You’re a Linux pro! Keep exploring and mastering new commands.
- 8-11 correct answers: Not bad! You’re getting there, try practicing some more commands to improve.
- Below 8: Keep going! Linux is powerful, and you’re just getting started.
Try practicing these commands more and check out our Linux Command Line Guide.
Conclusion
Linux is a powerful operating system, and mastering its basics is essential to using it effectively. Whether you’re administering servers or just using Linux on your personal machine, these fundamental commands will help you feel more comfortable navigating and managing your system.
For Question 14, none of the options list the correct answer, and the chosen answer is misleading.
“Question 14: What does the sudo command do?
A) Executes a command as another user
B) Starts a new shell
C) Copies files
D) Changes the system settings
Answer: A) Executes a command as another user”
You looked at the text under the NAME section in man sudo without understanding it.
More detailed explanation exists under the DESCRIPTION section in man sudo output.
DESCRIPTION
sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user’s real (not effective) user-ID is used to determine the user name with which to query the security policy.
@John,
Thank you for the detailed feedback!
You’re absolutely right, and I appreciate the clarification. The explanation under the DESCRIPTION section in
man sudo
provides a more complete understanding of the command. I agree that the wording in the question could be more precise.For clarity, the correct answer should be something like:
A) Executes a command as the superuser or another user, based on the security policy.
I’ve updated the answer to reflect this. Thanks again for pointing that out!
would have been better to have the answer card at the end of the article – can see the answers before given the chance to answer, otherwise good info
@Thanks,
Thanks for the great feedback!
You’re absolutely right – seeing the answers right away can take the fun out of the quiz.
I’ve now added an Answer Card at the end of the article so you can try out the questions first and check your answers afterward.
1(c),2(d),3(b),4(a),5(b),6(d),7(d),8(c),9(c),10(a),11(d),12(e),13(d),14(e),15(b)
the answer of question 9th is shebang the prefix used to write a script.
That’s what I answered, too. Never heard of ‘hashbang‘.
1(c)
2(c)
3(b)
4(b)
5(a)
6(A)
7(D)
8(C)
9(D)
10(a)
11(D)
12(E)
13(d)
14(d)
The answer of 12th question is w. It is used to see the login details of the users.
The answer of 5th question is own machine.. This IP is reserve IP basically to check the network card in your system..
this website provides great test
I want to take test exam for linux command line with you
1-c,2-d,3-b,4-c,5-b,6-d,7-a,8-d,9-d,10-c,11-d,12-a,13-b,14-b,15-a
1(c), 2(d), 3(b), 4(c), 5(b), 6(d), 7(a), 8(c), 9(d), 10(a), 11(d), 12(a), 13(c), 14(b), 15(a)
1 (c) ,2 (d), 3(b), 4(c), 5(e), 6(d), 7(d), 8(e),9 (d),10 (a),11 (d)
12(e) ,13 (d), 14 (c), 15 (a)
Answer: 1(b), 2(d), 3(b), 4(a), 5(b), 6(a), 7(d), 8(b), 9(c), 10(a), 11(d), 12(d), 13(c), 14(b), 15 (a)
1 (c) , 2 (d) , 3 (b) , 4 (b) , 5 (e) , 6 (d) , 7 (d) , 8 (e) , 9 (d) , 10 (a) , 11 (d)
1-c
2-d
3-b
4-c
5-a
6-a
7-d
8- i dont know ans
9-a
10-i dont know ans
11-d
12-a
13-i dont know ans
14-a
15-i dont know ans
Please fine below correct Answers :
1.(c),|2.(d),|3.(b),|4.(c),|5.(b),|6.(d),|7.(a),|8.(c),|9.(a),|10.(a),|11.(d),|12.(a),|13.(c),|14.(c),|15.(c)
Thanks 4 the reading ……..
1(c),2(d),3(b) 4(c),5(b),6(c),7(a),8(b),9(d),10(a),11(d),12(a),13(c),14(c),15(a)
1(c), 2(d), 3(b),4(a),5(b),6(c),7(c),8(b),
9(a),10(a),11(d),12(e),13(c),14(a),15(e)
1(c),2(d),3(b),4(c),5(b),6(c),7(a),8(c),9(a),10(a),11(d),12(a),13(b),14(c),15(b)
1(c), 2(d), 3(b),4(a),5(b),6(c),7(e),8(b),9(a),10(e),11(d),12(e),13(c),14(c),15(a)
Easy Questions…
1(c),2(c),3(b),4(b),5(b),6(c),7(a),8(c),9(c),10(d),11(d),12(c),13(c),14(c),15(c)
1 – c
2 – d
3 – b
4 – c
5 – b
6 – c
7 – a
8 – b
9 – d
10 – a
11 – d
12 – a
13 – c
14 – c
15- a
What are the correct answers. Please post them.
1(c),2(d),3(b),4(c),5(d),6(d),7(a),8(b),9(c),10(a),11(d),12(a),13(c),14(a),15(a)
1(c). 2(d) 3(b) 4(c) 5(b) 6(c) 7(a) 8(b) 9(c) 10(a) 11 (d) 12(a) 13(c) 14(b) 15(a)
1(c), 2(d), 3(b), 4(c), 5(b), 6(c), 7(a), 8(b), 9(d), 10(a), 11(d), 12(a), 13(c), 14(e), 15(a)
1(c)
2(d)
3(b)
4(a)
5(b)
6(c)
7(a)
8(c)
9(d)
10(a)
11(d)
12(a)
13(e)
14(b)
15(a)
1) c
2) d
3) b
4) b
5) b (localhost, loopback)
6) c)
7) a
8) b
9) a
10) e
11) d
12) a
13) c
14) a
15) c
1 (b) : wc is short for word count and there are other options in it to count lines.
2 (d) : rmdir is opposite of mkdir(make directory) and only removes empty ones.
3 (b) : rm is for remove
4 (c) : mactintosh is software platform and not hardware i think. Also , linux has support for the other options.
5 (b) : there is no place like 127.0.0.1
6 (c) : macintosh is based on BSD, which in turn is based on UNIX.
7 (a) : grep is used to search within a file. mail is to send mail to others, write can be used for interprocess communications via pipes/shared memory
8 (b) : just knew it
9 (c) : shebang/hashbang(#!) tells the path of which process can run the script.(/bin/bash for bash script, /usr/bin/python3 for python)
10 (a) : recursive definition like LINUX( Linux Is Not UniX)
11 (d) : every newbie should know this.
12 (a) : w tells the users currently logged in
13 (c) : guessed it, (opposite of lpr)
14 (c) : virtualbox and vmware both can run windows ON LINUX and vice-versa, not parallely, but colinux can do it
15 (b) : red-hat is the largest commercial one and ubuntu is the largest non-commercial one
Answers : 1(c), 2(d), 3(b), 4(c), 5(e), 6(d), 7(a), 8(b), 9(d), 10(a), 11(d), 12(a), 13(c), 14(c), 15(a)
1(c) : wc is used to count lines and characters with its options -l(for Lines) and -m for Characters, and this was the only working command in the option lists.
2(d) : rmdir is used to delete empty folders, and no other command exists.
3(b) : rm is used to remove files
4(c) : Macintosh is Apple based hardware which does not support any other OS other than Mac. However some people have acheived this as well.. :P
5(e) : Its the address of local host or loopback.
6(d) : Apple
7(a) : grep is used for pattern base search,not for communication.
8(b) : lpr is used to manage print related tasks, cupsd
9(d) : Both shebang and hashbang is popular.
10(a) : GNU is not Unix.
11(d) : ls is used to list the contents of a directory.
12(a) : “w” is used to see ll the current users online on the system.
13(c) : lprm is used to remove the jobs from the print queue.
14(c) : coLinux, co-operativelinux allows to run windows and linux kernel parallel on the same machine at the same time.
15(a) : Debian , one of your post only told this before some days. :)
1)c, 2)d, 3)b, 4)d, 5)b, 6) d [Macintosh is an apple trademark no an OS, that would be OSX], 7)a, 8)b, 9)b, 10)a, 11)d, 12)a, 13)c, 14)a, 15)b
1(c)
2(c)
3(b)
4(a)
5(b)
6(c)
7(a)
8(c)
9(a)
10(a)
11(d)
12(a)
13(c)
14(b)
15(a)
1 (c)
2 (d)
3 (b)
4
5 (b)
6 (d)
7 (a)
8
9 (a)
10 (a)
11 (d)
12 (a)
13
14 (c)
15 (b)
1(c), 2(d), 3(b), 4(c), 5(b), 6(d), 7(a), 8(b), 9(d), 10(a), 11(d), 12(a), 13(c), 14(a), 15(b)
1(c) : wc -l option is used to count lines, wc -m used to count characters, Ex: wc -lm temp.txt
2(d) : rmdir remove empty directory.
3(b) : rm command used . Ex: rm temp.txt
4(c) : Macintosh is Apple base hardware which does not allow other OS to support other than Mac.
5(b) : It is used to test software during development for developers.It is independent from any other network.
6(d) : macintosh is developed by Apple.
7(a) : grep is used to find matching strings.. not used for communication purpose.
8(b) : ex: lpr temp.txt, lpr push the data in printing queue, lpd prints the data.
9(d) : # character is not consider. and hashbang is also called as Shebang.
10(a) : Stallman runs the free s/w foundation named GNU. It is ‘Genuinely not Unix’.
11(d) : ls command list all the files which are available in directory : Ex: ls machine
12(a) : w command shows who is the current user of Linux.
13(c) : lprm command removes the job from print queue.. ‘rm’ shows remove.
14(a) : Some experts tools are available in virtualBox that is useful running 2 different OS simultaneously.
15(b) : Ubantu provides long term support, security, used for commercial and no commercial both.
1(c)
2(d)
3(b)
4(c)
5(b)
6(c)
7(a)
8(b)
9(a)
10(a)
11(d)
12(a)
13(a)
14(a)
15(a)
1(c), 2(b), 3(b), 4(d), 5(b), 6(d). 7(c), 8(c), 9(d), 10(a), 11(d), 12(d), 13(c), 14(c), 15(a)
01)wc
02)rmdir
03)rm
04)macintosh
05)Own Machine
06)Apple
07)grep
08)lpr
09)shebang
10)GNU’s not Unix
11)ls
12)w
13)lpr
14)Cooperative Linux (coLinux)
15)Debian
1.c
2.d
3.b
4.d
5.b
6.c
7.a
8.b
9.c
10.a
11.d
12.w
13.c
14.c
15.a
Answers:– 1(c),2(c),3(b),4(c),5(E),6(D),7(a),8(c),9(a),10(E),11(D),12(a),13(b),
14(E),15(D).
Answer: 1(c), 2(d), 3(b), 4(c), 5(b), 6(c), 7(a), 8(b), 9(d), 10(a), 11(d), 12(a), 13(c), 14(c), 15 (a)
1(c), 2(d), 3(b), 4(a), 5(b), 6(a), 7(a), 8(c), 9(a), 10(a), 11(d), 12(a), 13c, 14(b), 15 (d)
1c, 2c, 3b, 4c, 5b, 6d, 7a, 8c, 9b, 10a, 11d, 12d, 13d, 14a, 15e
Answers: 1(c), 2(d), 3(b), 4(c), 5(b), 6(c), 7(a), 8(b), 9(d), 10(a), 11(d), 12(a), 13(b), 14(b), 15(b)
1(c), 2(d), 3(b), 4(e), 5(b), 6(d), 7(1), 8(b), 9(b), 10(a), 11(d), 12(a), 13(c), 14(e), 15(a)
1(c),2(d),3(b),4(a),5(b),6(c),7(a),8(d),9(d),10(a),11(d),12(a),13(c),14(b),15(b)
=) I like quizzes like this, not so sure about the printing but, everything else was really easy.
Answers to Quiz 2:
1(c), 2(d), 3(b), 4(c), 5(b), 6(c), 7(a), 8(b), 9(d), 10(a), 11(d), 12(a), 13(c), 14(c), 15(a).
All the best everyone!!!
Abdul.
[email protected]
Answers:
2(4) *by rmdir it only remove empty directories,
3(2) *by rm we can remove files & folders too by using (-r) switch,
5(2) *127.0.0.1 is our loop back address or local host address do, when we put http://127.0.0.1 it will send request to our apache server; if service is available then we get the webpage,
6(3) *Mac uses the kernal of UNIX so it comes under *nix family,
9(3) *bash (bourne again shell) it executes cmd’s from terminal or from file,
10(1) *Gnu’s is an organization,
11(4) *ls stands for listing (contents of folder or directory),
14(1) *virtual box provide virtual guest OS , 15(2) *Ubuntu is open source, regular updates,. quick bug fix, fast
1(c), 2(d), 3(b), 4(c), 5(b), 6(c), 7(a), 8(a), 9(d), 10(a), 11(d), 12(a), 13(c), 14(a), 15(a)
1)C
2)C
3)B
3)C
5)A
6)D
7)A
8)B
9)C
10)A
11)D
12)D
13)C
14)A
15)C
Name:Utsav Rana
Email:[email protected]
answers : 1(c). 2(d) 3(b) 4(c) 5(b) 6(c) 7(a) 8(b) 9(c) 10(A) 11 (d) 12(d) 13(c) 14(b) 15(a)
1 :- c
2 :- d
3 :- b
4 :- c
5 :- b
6 :- d
7 :- a
8 :- b
9 :- c
10 :- a
11 :- d
12 :- a
13 :- c
14 :- a
15 :- a